{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 1.地理编码"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import requests"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "geocode_url = \"https://restapi.amap.com/v3/geocode/geo?parameters\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "sxt_key = \"de6216071f58b9c3b96bf20013f009e2\"\n",
    "address = \"广东省广州市中山大学南方学院\"\n",
    "params = {\n",
    "    \"key\":sxt_key,\n",
    "    \"address\":address,\n",
    "    \"output\":\"json\"\n",
    "}\n",
    "response = requests.get(url=geocode_url,params=params)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Response [200]>"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "response"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000',\n",
       " 'count': '1',\n",
       " 'geocodes': [{'formatted_address': '广东省广州市从化区中山大学南方学院',\n",
       "   'country': '中国',\n",
       "   'province': '广东省',\n",
       "   'citycode': '020',\n",
       "   'city': '广州市',\n",
       "   'district': '从化区',\n",
       "   'township': [],\n",
       "   'neighborhood': {'name': [], 'type': []},\n",
       "   'building': {'name': [], 'type': []},\n",
       "   'adcode': '440117',\n",
       "   'street': [],\n",
       "   'number': [],\n",
       "   'location': '113.679287,23.632575',\n",
       "   'level': '兴趣点'}]}"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "response.json()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'113.679287,23.632575'"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "中大南方_location = response.json()['geocodes'][0]['location']\n",
    "中大南方_location"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 2.逆地理编码\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "def regeo(key,location,extensions=\"base\",radius=None,poitype=None):\n",
    "    \"\"\"高德逆地理编码获取\"\"\"\n",
    "    url = \"https://restapi.amap.com/v3/geocode/regeo?parameters\"\n",
    "    params = {\n",
    "        \"key\":key,\n",
    "        \"location\":location,\n",
    "        \"extensions\":extensions,\n",
    "        \"radius\":radius,\n",
    "        \"poitype\":poitype\n",
    "    }\n",
    "    r = requests.get(url=url,params=params)\n",
    "    results = r.json()\n",
    "    return results"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'regeocode': {'addressComponent': {'city': '广州市',\n",
       "   'province': '广东省',\n",
       "   'adcode': '440117',\n",
       "   'district': '从化区',\n",
       "   'towncode': '440117103000',\n",
       "   'streetNumber': {'number': '7号',\n",
       "    'location': '113.678600,23.633329',\n",
       "    'direction': '西北',\n",
       "    'distance': '109.203',\n",
       "    'street': '博学路'},\n",
       "   'country': '中国',\n",
       "   'township': '温泉镇',\n",
       "   'businessAreas': [{'location': '113.648930,23.636205',\n",
       "     'name': '温泉',\n",
       "     'id': '440117'}],\n",
       "   'building': {'name': [], 'type': []},\n",
       "   'neighborhood': {'name': [], 'type': []},\n",
       "   'citycode': '020'},\n",
       "  'formatted_address': '广东省广州市从化区温泉镇中山大学南方学院'},\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000'}"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "regeo(key=sxt_key,location=中大南方_location,radius=30000)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "url_regeo=\"https://restapi.amap.com/v3/geocode/regeo?parameters\"\n",
    "params={\n",
    "    \"key\":sxt_key,\n",
    "    \"location\":中大南方_location,\n",
    "    \"extensions\":\"all\"\n",
    "}\n",
    "r=requests.get(url=url_regeo,params=params)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Response [200]>"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['博学路', '中山路', 'S29从莞深高速']"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "_roads_ = []\n",
    "for item in r.json()['regeocode']['roads']:\n",
    "#     print(item['name'])\n",
    "    _roads_.append(item['name'])\n",
    "_roads_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'regeocode': {'roads': [{'id': '020F49F0050461203',\n",
       "    'location': '113.68,23.634',\n",
       "    'direction': '南',\n",
       "    'name': '博学路',\n",
       "    'distance': '156.951'},\n",
       "   {'id': '020F49F0050462451',\n",
       "    'location': '113.677,23.6347',\n",
       "    'direction': '东南',\n",
       "    'name': '中山路',\n",
       "    'distance': '343.951'},\n",
       "   {'id': '020F49F006047765',\n",
       "    'location': '113.682,23.6394',\n",
       "    'direction': '南',\n",
       "    'name': 'S29从莞深高速',\n",
       "    'distance': '807.947'}],\n",
       "  'roadinters': [{'second_name': '中山路',\n",
       "    'first_id': '020F49F0050461203',\n",
       "    'second_id': '020F49F0050462451',\n",
       "    'location': '113.676794,23.634661',\n",
       "    'distance': '343.951',\n",
       "    'first_name': '博学路',\n",
       "    'direction': '东南'}],\n",
       "  'formatted_address': '广东省广州市从化区温泉镇中山大学南方学院',\n",
       "  'addressComponent': {'city': '广州市',\n",
       "   'province': '广东省',\n",
       "   'adcode': '440117',\n",
       "   'district': '从化区',\n",
       "   'towncode': '440117103000',\n",
       "   'streetNumber': {'number': '7号',\n",
       "    'location': '113.678600,23.633329',\n",
       "    'direction': '西北',\n",
       "    'distance': '109.203',\n",
       "    'street': '博学路'},\n",
       "   'country': '中国',\n",
       "   'township': '温泉镇',\n",
       "   'businessAreas': [[]],\n",
       "   'building': {'name': [], 'type': []},\n",
       "   'neighborhood': {'name': [], 'type': []},\n",
       "   'citycode': '020'},\n",
       "  'aois': [{'area': '536585.849985',\n",
       "    'type': '141201',\n",
       "    'id': 'B00140MR9A',\n",
       "    'location': '113.679262,23.632583',\n",
       "    'adcode': '440117',\n",
       "    'name': '中山大学南方学院',\n",
       "    'distance': '0'}],\n",
       "  'pois': [{'id': 'B00140MR9A',\n",
       "    'direction': '西',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道882号',\n",
       "    'poiweight': '0.450402',\n",
       "    'name': '中山大学南方学院',\n",
       "    'location': '113.679262,23.632583',\n",
       "    'distance': '2.69979',\n",
       "    'tel': '020-61787331',\n",
       "    'type': '科教文化服务;学校;高等院校'},\n",
       "   {'id': 'B0FFF2VMJ4',\n",
       "    'direction': '东南',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道886号中山大学南方学院内',\n",
       "    'poiweight': '0.148531',\n",
       "    'name': '中山大学南方学院-综合楼',\n",
       "    'location': '113.680117,23.631544',\n",
       "    'distance': '142.466',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B0FFFTC9PH',\n",
       "    'direction': '东北',\n",
       "    'businessarea': [],\n",
       "    'address': '从莞深高速(中山大学南方学院)',\n",
       "    'poiweight': '0.193172',\n",
       "    'name': '中山大学南方学院教学楼10号',\n",
       "    'location': '113.680125,23.633492',\n",
       "    'distance': '132.988',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B00141TQKX',\n",
       "    'direction': '西北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道882',\n",
       "    'poiweight': '0.148531',\n",
       "    'name': '中山大学南方学院教学楼6号',\n",
       "    'location': '113.678424,23.633710',\n",
       "    'distance': '153.818',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;学校'},\n",
       "   {'id': 'B00141TQGR',\n",
       "    'direction': '西北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路7',\n",
       "    'poiweight': '0.148531',\n",
       "    'name': '中山大学南方学院教学楼7号',\n",
       "    'location': '113.678600,23.633330',\n",
       "    'distance': '109.298',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;高等院校'},\n",
       "   {'id': 'B00141WQCO',\n",
       "    'direction': '东北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路',\n",
       "    'poiweight': '0.14954',\n",
       "    'name': '中山大学南方学院教学楼8号',\n",
       "    'location': '113.680399,23.634329',\n",
       "    'distance': '225.543',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0FFG9IORM',\n",
       "    'direction': '西北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道882号中山大学南方学院内',\n",
       "    'poiweight': '0.287887',\n",
       "    'name': '中山大学南方学院-图书馆',\n",
       "    'location': '113.679177,23.632762',\n",
       "    'distance': '23.6163',\n",
       "    'tel': '020-61787368;020-61787371',\n",
       "    'type': '科教文化服务;图书馆;图书馆'},\n",
       "   {'id': 'B0FFKP9EQJ',\n",
       "    'direction': '东',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路附近',\n",
       "    'poiweight': '0.191742',\n",
       "    'name': '中山大学南方学院4号实验楼',\n",
       "    'location': '113.679963,23.632652',\n",
       "    'distance': '69.4077',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0FFJKIA10',\n",
       "    'direction': '东北',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉大道882号中山大学南方学院',\n",
       "    'poiweight': '0.191691',\n",
       "    'name': '中山大学南方学院-第11教学楼',\n",
       "    'location': '113.680037,23.633173',\n",
       "    'distance': '101.294',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B00141TRVH',\n",
       "    'direction': '西南',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路21',\n",
       "    'poiweight': '0.148531',\n",
       "    'name': '中山大学南方学院教学楼2号',\n",
       "    'location': '113.677060,23.631346',\n",
       "    'distance': '264.846',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0FFKERBQZ',\n",
       "    'direction': '西北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路7号附近',\n",
       "    'poiweight': '0.289141',\n",
       "    'name': '中山大学南方学院惟贤门',\n",
       "    'location': '113.678437,23.633721',\n",
       "    'distance': '154.082',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;高等院校'},\n",
       "   {'id': 'B0FFKP81F4',\n",
       "    'direction': '东北',\n",
       "    'businessarea': [],\n",
       "    'address': '中山路',\n",
       "    'poiweight': '0.191742',\n",
       "    'name': '政商研究院教学楼9号',\n",
       "    'location': '113.679949,23.633919',\n",
       "    'distance': '163.951',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0FFKP9ET5',\n",
       "    'direction': '西南',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路附近',\n",
       "    'poiweight': '0.191742',\n",
       "    'name': '中山大学南方学院1号实验楼',\n",
       "    'location': '113.678215,23.631370',\n",
       "    'distance': '172.86',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B00141TR76',\n",
       "    'direction': '西南',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路29',\n",
       "    'poiweight': '0.052819',\n",
       "    'name': '中山大学南方学院教学楼4号',\n",
       "    'location': '113.677460,23.630490',\n",
       "    'distance': '297.315',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0FFKP7Q5N',\n",
       "    'direction': '西南',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路',\n",
       "    'poiweight': '0.191742',\n",
       "    'name': '中山大学南方学院2号实验楼',\n",
       "    'location': '113.678211,23.630956',\n",
       "    'distance': '210.76',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B00140TWHT',\n",
       "    'direction': '南',\n",
       "    'businessarea': [],\n",
       "    'address': '笃行路2号',\n",
       "    'poiweight': '0.157653',\n",
       "    'name': '教工住宅1号',\n",
       "    'location': '113.678490,23.630432',\n",
       "    'distance': '251.758',\n",
       "    'tel': [],\n",
       "    'type': '商务住宅;住宅区;住宅小区'},\n",
       "   {'id': 'B0G3ARGF5Y',\n",
       "    'direction': '西',\n",
       "    'businessarea': [],\n",
       "    'address': [],\n",
       "    'poiweight': '0.286321',\n",
       "    'name': '中山大学南方学院教学楼1号',\n",
       "    'location': '113.677077,23.631783',\n",
       "    'distance': '241.753',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;学校;高等院校'},\n",
       "   {'id': 'B0FFLBEOND',\n",
       "    'direction': '东南',\n",
       "    'businessarea': [],\n",
       "    'address': '从莞深高速(中山大学南方学院)',\n",
       "    'poiweight': '0.190963',\n",
       "    'name': '聚贤楼10号',\n",
       "    'location': '113.681253,23.631036',\n",
       "    'distance': '263.444',\n",
       "    'tel': [],\n",
       "    'type': '商务住宅;住宅区;宿舍'},\n",
       "   {'id': 'B0FFKP81F0',\n",
       "    'direction': '西',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路19号附近',\n",
       "    'poiweight': '0.191742',\n",
       "    'name': '教学楼1号(文学与传媒学院)',\n",
       "    'location': '113.676866,23.631736',\n",
       "    'distance': '263.674',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0FFKP838K',\n",
       "    'direction': '西南',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路25',\n",
       "    'poiweight': '0.191742',\n",
       "    'name': '教学楼3号(外国语学院)',\n",
       "    'location': '113.677247,23.630947',\n",
       "    'distance': '275.62',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0FFJLW0O9',\n",
       "    'direction': '西',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路4附近',\n",
       "    'poiweight': '0.191645',\n",
       "    'name': '中山大学南方学院西区饭堂',\n",
       "    'location': '113.676210,23.632177',\n",
       "    'distance': '316.572',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0FFKPXMCN',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '中山路',\n",
       "    'poiweight': '0.191739',\n",
       "    'name': '中山大学南方学院音乐系',\n",
       "    'location': '113.678792,23.635389',\n",
       "    'distance': '316.942',\n",
       "    'tel': [],\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所'},\n",
       "   {'id': 'B0FFJBZLYT',\n",
       "    'direction': '西北',\n",
       "    'businessarea': [],\n",
       "    'address': '中山路与博学路交叉口东南50米',\n",
       "    'poiweight': '0.297382',\n",
       "    'name': '铜像广场',\n",
       "    'location': '113.676921,23.634555',\n",
       "    'distance': '326.444',\n",
       "    'tel': [],\n",
       "    'type': '风景名胜;风景名胜;风景名胜'},\n",
       "   {'id': 'B0FFG8CSEK',\n",
       "    'direction': '东',\n",
       "    'businessarea': [],\n",
       "    'address': '从莞深高速(中山大学南方学院)',\n",
       "    'poiweight': '0.185371',\n",
       "    'name': 'L5员工宿舍',\n",
       "    'location': '113.682583,23.631487',\n",
       "    'distance': '356.923',\n",
       "    'tel': [],\n",
       "    'type': '商务住宅;住宅区;宿舍'},\n",
       "   {'id': 'B0FFKPXO2S',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '博学路附近',\n",
       "    'poiweight': '0.188247',\n",
       "    'name': '中山大学南方学院医务室',\n",
       "    'location': '113.679394,23.635924',\n",
       "    'distance': '372.556',\n",
       "    'tel': [],\n",
       "    'type': '医疗保健服务;医疗保健服务场所;医疗保健服务场所'},\n",
       "   {'id': 'B0FFH6K3U9',\n",
       "    'direction': '西南',\n",
       "    'businessarea': [],\n",
       "    'address': '温泉镇温泉大道882号中大南方H7栋1-5层',\n",
       "    'poiweight': '0.254885',\n",
       "    'name': '广州中大南方招待所',\n",
       "    'location': '113.676330,23.631332',\n",
       "    'distance': '331.438',\n",
       "    'tel': '020-61787222',\n",
       "    'type': '住宿服务;住宿服务相关;住宿服务相关'},\n",
       "   {'id': 'B0FFHHLMF8',\n",
       "    'direction': '东北',\n",
       "    'businessarea': [],\n",
       "    'address': '中山大学南方学院明辩路2号第三饭堂',\n",
       "    'poiweight': '0.178935',\n",
       "    'name': '茗语轩餐厅',\n",
       "    'location': '113.681901,23.634495',\n",
       "    'distance': '341.332',\n",
       "    'tel': '13929501395;13533390928',\n",
       "    'type': '餐饮服务;中餐厅;中餐厅'},\n",
       "   {'id': 'B0FFLJV996',\n",
       "    'direction': '东南',\n",
       "    'businessarea': [],\n",
       "    'address': [],\n",
       "    'poiweight': '0.286264',\n",
       "    'name': '保利桃花源66BLOCK',\n",
       "    'location': '113.682954,23.631008',\n",
       "    'distance': '412.208',\n",
       "    'tel': [],\n",
       "    'type': '商务住宅;住宅区;住宅小区'},\n",
       "   {'id': 'B0FFKPXY26',\n",
       "    'direction': '北',\n",
       "    'businessarea': [],\n",
       "    'address': '从莞深高速公路',\n",
       "    'poiweight': '0.21826',\n",
       "    'name': '中山大学南方学院聚贤楼5号',\n",
       "    'location': '113.680265,23.636313',\n",
       "    'distance': '427.447',\n",
       "    'tel': [],\n",
       "    'type': '商务住宅;商务住宅相关;商务住宅相关'},\n",
       "   {'id': 'B0FFGXGN3K',\n",
       "    'direction': '东',\n",
       "    'businessarea': [],\n",
       "    'address': '中山大学南方学院',\n",
       "    'poiweight': '0.188657',\n",
       "    'name': '中山大学南方学院宿舍H25',\n",
       "    'location': '113.683474,23.632020',\n",
       "    'distance': '430.984',\n",
       "    'tel': [],\n",
       "    'type': '商务住宅;住宅区;宿舍'}]},\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000'}"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r.json()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 3.路径规划"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "3.1  步行路径规划"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "def walking(key,origin,location,sig=None,output='json',callback=None):\n",
    "    url='https://restapi.amap.com/v3/direction/walking?parameters'\n",
    "    params={\n",
    "        'key':key,\n",
    "        'origin':origin,\n",
    "        'destination':location,\n",
    "        'sig':sig,\n",
    "        'output':output,\n",
    "        'callback':callback,\n",
    "    }\n",
    "    response=requests.get(url,params)\n",
    "    results=response.json()\n",
    "    return results"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'info': 'ok',\n",
       " 'infocode': '10000',\n",
       " 'count': '1',\n",
       " 'route': {'origin': '113.678600,23.633329',\n",
       "  'destination': '113.679177,23.632762',\n",
       "  'paths': [{'distance': '203',\n",
       "    'duration': '162',\n",
       "    'steps': [{'instruction': '向东北步行115米右转',\n",
       "      'orientation': '东北',\n",
       "      'road': [],\n",
       "      'distance': '115',\n",
       "      'duration': '92',\n",
       "      'polyline': '113.678724,23.633251;113.679466,23.633915;113.679549,23.633967',\n",
       "      'action': '右转',\n",
       "      'assistant_action': [],\n",
       "      'walk_type': '0'},\n",
       "     {'instruction': '向南步行32米向右前方行走',\n",
       "      'orientation': '南',\n",
       "      'road': [],\n",
       "      'distance': '32',\n",
       "      'duration': '26',\n",
       "      'polyline': '113.679549,23.633967;113.679648,23.633694',\n",
       "      'action': '向右前方行走',\n",
       "      'assistant_action': [],\n",
       "      'walk_type': '0'},\n",
       "     {'instruction': '向南步行56米到达目的地',\n",
       "      'orientation': '南',\n",
       "      'road': [],\n",
       "      'distance': '56',\n",
       "      'duration': '45',\n",
       "      'polyline': '113.679648,23.633689;113.679627,23.633655;113.679596,23.633255;113.679596,23.633255;113.679596,23.633177',\n",
       "      'action': [],\n",
       "      'assistant_action': '到达目的地',\n",
       "      'walk_type': '0'}]}]}}"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "key='de6216071f58b9c3b96bf20013f009e2'\n",
    "origin='113.678600,23.633329'\n",
    "location='113.679177,23.632762'\n",
    "walking(key,origin,location,sig=None,output='json',callback=None)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0      向东北步行115米右转\n",
       "1    向南步行32米向右前方行走\n",
       "2     向南步行56米到达目的地\n",
       "Name: instruction, dtype: object"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a=walking(key,origin,location,sig=None,output='json',callback=None)['route']['paths'][0]['steps']\n",
    "import pandas as pd\n",
    "pd.json_normalize(a).instruction\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "3.2公交路径规划"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [],
   "source": [
    "def transit(origin,location,city,cityid=None,extensions='base',strategy=0,nightflag=0,\n",
    "            date=None,time=None,sig=None,output='json',callback=None):  \n",
    "    url='https://restapi.amap.com/v3/direction/transit/integrated?parameters'  \n",
    "    params={\n",
    "        'key':key,\n",
    "        'origin':origin,\n",
    "        'destination':location,\n",
    "        'city':city,\n",
    "        'cityid':cityid,\n",
    "        'extensions':extensions,\n",
    "        'strategy':strategy,\n",
    "        'nightflag':nightflag,\n",
    "        'date':date,\n",
    "        'time':time,\n",
    "        'sig':sig,\n",
    "        'output':output,\n",
    "        'callback':callback          \n",
    "    }    \n",
    "    response=requests.get(url,params)    \n",
    "    results=response.json()  \n",
    "    return results"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000',\n",
       " 'count': '5',\n",
       " 'route': {'origin': '113.678600,23.633329',\n",
       "  'destination': '113.668051,23.600869',\n",
       "  'distance': '4285',\n",
       "  'taxi_cost': '18',\n",
       "  'transits': [{'cost': '4.0',\n",
       "    'duration': '5192',\n",
       "    'nightflag': '0',\n",
       "    'walking_distance': '961',\n",
       "    'distance': '14868',\n",
       "    'missed': '0',\n",
       "    'segments': [{'taxi': [],\n",
       "      'walking': {'origin': '113.678581,23.633133',\n",
       "       'destination': '113.676613,23.631285',\n",
       "       'distance': '518',\n",
       "       'duration': '444',\n",
       "       'steps': [{'instruction': '步行53米左转',\n",
       "         'road': [],\n",
       "         'distance': '53',\n",
       "         'duration': [],\n",
       "         'polyline': '113.678581,23.633133;113.678627,23.633081;113.678619,23.633038;113.678452,23.632895;113.678421,23.632877;113.678360,23.632877;113.678307,23.632921',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行113米右转',\n",
       "         'road': [],\n",
       "         'distance': '113',\n",
       "         'duration': [],\n",
       "         'polyline': '113.678307,23.632921;113.677582,23.632309;113.677559,23.632278;113.677551,23.632200',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行161米左转',\n",
       "         'road': [],\n",
       "         'distance': '161',\n",
       "         'duration': [],\n",
       "         'polyline': '113.677544,23.632196;113.677399,23.632179;113.677284,23.632200;113.677177,23.632244;113.677017,23.632357;113.676811,23.632534;113.676582,23.632778;113.676430,23.632904;113.676292,23.632969',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿博学路步行191米到达中大南方学院',\n",
       "         'road': '博学路',\n",
       "         'distance': '191',\n",
       "         'duration': [],\n",
       "         'polyline': '113.676285,23.632969;113.676292,23.632227;113.676338,23.631948;113.676430,23.631676;113.676491,23.631540;113.676613,23.631285',\n",
       "         'action': [],\n",
       "         'assistant_action': '到达中大南方学院'}]},\n",
       "      'bus': {'buslines': [{'departure_stop': {'name': '中大南方学院',\n",
       "          'id': '900000111141002',\n",
       "          'location': '113.676613,23.631281'},\n",
       "         'arrival_stop': {'name': '宣星路口',\n",
       "          'id': '900000111141010',\n",
       "          'location': '113.628891,23.602587'},\n",
       "         'name': '从15路(中大南方学院--从化汽车站总站)',\n",
       "         'id': '900000111141',\n",
       "         'type': '普通公交线路',\n",
       "         'distance': '9953',\n",
       "         'duration': '2213',\n",
       "         'polyline': '113.676613,23.631281;113.676460,23.631588;113.676430,23.631672;113.676338,23.631945;113.676292,23.632223;113.676285,23.632969;113.676285,23.633560;113.676300,23.633738;113.676331,23.633875;113.676399,23.634016;113.676460,23.634111;113.676521,23.634193;113.676781,23.634409;113.676857,23.634357;113.676933,23.634340;113.677032,23.634354;113.677094,23.634396;113.677139,23.634459;113.677147,23.634535;113.677139,23.634600;113.677086,23.634663;113.677032,23.634701;113.676918,23.634718;113.676857,23.634701;113.676788,23.634657;113.675262,23.636129;113.675156,23.636263;113.675026,23.636467;113.674973,23.636566;113.674957,23.636702;113.674957,23.636845;113.674995,23.636995;113.675377,23.637886;113.675430,23.638042;113.675522,23.638659;113.675529,23.638998;113.675514,23.639132;113.675446,23.639311;113.675331,23.639582;113.675102,23.640036;113.675003,23.640186;113.674309,23.641024;113.673347,23.642139;113.672981,23.642536;113.672935,23.642578;113.672173,23.643307;113.671707,23.643766;113.671432,23.644045;113.673103,23.644968;113.674362,23.645651;113.675461,23.646276;113.675964,23.646635;113.676407,23.647018;113.676376,23.647089;113.675964,23.646744;113.675735,23.646566;113.675468,23.646385;113.675095,23.646172;113.673004,23.645004;113.669968,23.643330;113.669167,23.642881;113.668770,23.642673;113.668594,23.642578;113.667007,23.641693;113.666145,23.641171;113.665314,23.640564;113.665253,23.640511;113.665016,23.640301;113.664772,23.640064;113.664551,23.639812;113.664406,23.639662;113.664207,23.639400;113.663925,23.639021;113.663574,23.638451;113.663361,23.638020;113.662323,23.635933;113.661949,23.635181;113.661461,23.634266;113.661224,23.633898;113.660843,23.633383;113.660683,23.633192;113.660248,23.632704;113.659721,23.632172;113.659370,23.631880;113.659256,23.631794;113.658989,23.631588;113.658897,23.631519;113.658211,23.631102;113.657707,23.630760;113.657425,23.630590;113.656944,23.630304;113.656940,23.630304;113.654336,23.628741;113.653850,23.628416;113.653598,23.628225;113.652383,23.627179;113.650165,23.625326;113.650022,23.625221;113.649766,23.625013;113.649731,23.624987;113.649731,23.624983;113.648980,23.624384;113.648611,23.624063;113.647843,23.623442;113.647361,23.623090;113.646780,23.622721;113.646345,23.622465;113.645981,23.622287;113.645595,23.622131;113.645117,23.621992;113.644709,23.621914;113.644640,23.621901;113.644635,23.621901;113.644375,23.621862;113.643255,23.621749;113.642578,23.621667;113.642474,23.621645;113.642027,23.621541;113.641450,23.621354;113.640525,23.621033;113.639332,23.620603;113.639184,23.620543;113.638850,23.620412;113.638433,23.620213;113.638325,23.620156;113.638329,23.620155;113.636047,23.618944;113.635544,23.618668;113.635254,23.618481;113.634750,23.618097;113.634514,23.617891;113.634254,23.617622;113.633980,23.617271;113.633636,23.616779;113.633057,23.615911;113.632957,23.615774;113.632401,23.614927;113.631912,23.614172;113.631660,23.613710;113.631432,23.613142;113.631287,23.612659;113.630905,23.611076;113.630844,23.610802;113.630844,23.610798;113.630768,23.610516;113.630661,23.610060;113.630569,23.609705;113.630554,23.609617;113.630501,23.609388;113.630119,23.607822;113.629776,23.606388;113.629395,23.604740;113.628891,23.602587',\n",
       "         'bustimetag': '0',\n",
       "         'start_time': '0900',\n",
       "         'end_time': '1800',\n",
       "         'via_num': '7',\n",
       "         'via_stops': [{'name': '卫东',\n",
       "           'id': '900000111141003',\n",
       "           'location': '113.671707,23.643766'},\n",
       "          {'name': '交警温泉中队',\n",
       "           'id': '900000111141029',\n",
       "           'location': '113.656944,23.630304'},\n",
       "          {'name': '冲口',\n",
       "           'id': '900000111141022',\n",
       "           'location': '113.649731,23.624987'},\n",
       "          {'name': '牛步迳',\n",
       "           'id': '900000111141006',\n",
       "           'location': '113.644640,23.621901'},\n",
       "          {'name': '华辉度假村',\n",
       "           'id': '900000111141023',\n",
       "           'location': '113.638325,23.620156'},\n",
       "          {'name': '温泉镇政府',\n",
       "           'id': '900000111141008',\n",
       "           'location': '113.632957,23.615774'},\n",
       "          {'name': '云星村',\n",
       "           'id': '900000111141024',\n",
       "           'location': '113.630844,23.610802'}]}]},\n",
       "      'entrance': [],\n",
       "      'exit': [],\n",
       "      'railway': {'via_stops': [], 'alters': [], 'spaces': []}},\n",
       "     {'taxi': [],\n",
       "      'walking': {'origin': '113.628891,23.602587',\n",
       "       'destination': '113.628723,23.601263',\n",
       "       'distance': '263',\n",
       "       'duration': '225',\n",
       "       'steps': [{'instruction': '沿温泉大道步行52米右转',\n",
       "         'road': '温泉大道',\n",
       "         'distance': '52',\n",
       "         'duration': [],\n",
       "         'polyline': '113.628891,23.602587;113.628998,23.603046',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行13米右转',\n",
       "         'road': [],\n",
       "         'distance': '13',\n",
       "         'duration': [],\n",
       "         'polyline': '113.629005,23.603046;113.629120,23.603025',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿温泉大道步行198米到达宣星路口',\n",
       "         'road': '温泉大道',\n",
       "         'distance': '198',\n",
       "         'duration': [],\n",
       "         'polyline': '113.629120,23.603022;113.628906,23.602083;113.628815,23.601658;113.628723,23.601263',\n",
       "         'action': [],\n",
       "         'assistant_action': '到达宣星路口'}]},\n",
       "      'bus': {'buslines': [{'departure_stop': {'name': '宣星路口',\n",
       "          'id': '900000111131022',\n",
       "          'location': '113.628720,23.601263'},\n",
       "         'arrival_stop': {'name': '教师村',\n",
       "          'id': '900000111131041',\n",
       "          'location': '113.666658,23.601437'},\n",
       "         'name': '从14路(从化汽车站总站--高坣总站)',\n",
       "         'id': '900000111131',\n",
       "         'type': '普通公交线路',\n",
       "         'distance': '3954',\n",
       "         'duration': '2156',\n",
       "         'polyline': '113.628720,23.601263;113.628720,23.601259;113.628811,23.601658;113.629280,23.601780;113.630113,23.601445;113.630365,23.601354;113.632248,23.600681;113.633785,23.600347;113.635725,23.599957;113.636810,23.599731;113.637335,23.599657;113.638103,23.599596;113.638542,23.599579;113.639266,23.599588;113.639427,23.599592;113.642270,23.599570;113.642578,23.599570;113.643043,23.599622;113.643294,23.599653;113.643290,23.599653;113.643581,23.599688;113.643624,23.599661;113.643911,23.599657;113.644232,23.599605;113.644449,23.599614;113.645451,23.599935;113.646454,23.600278;113.646589,23.600347;113.646658,23.600417;113.646931,23.600595;113.649835,23.601749;113.649935,23.601797;113.650030,23.601862;113.650937,23.602674;113.651063,23.602752;113.651176,23.602786;113.651367,23.602826;113.651584,23.602847;113.651845,23.602847;113.652001,23.602830;113.652504,23.602708;113.652839,23.602582;113.652999,23.602548;113.653181,23.602543;113.653264,23.602561;113.653659,23.602752;113.653802,23.602799;113.654605,23.602977;113.655122,23.603069;113.655243,23.603077;113.655391,23.603069;113.655799,23.602999;113.656055,23.602934;113.656302,23.602847;113.657083,23.602530;113.657300,23.602461;113.657500,23.602418;113.659041,23.602205;113.659501,23.602144;113.660009,23.602170;113.660386,23.602144;113.661046,23.601988;113.661115,23.601975;113.661115,23.601970;113.661115,23.601975;113.661845,23.601801;113.662044,23.601740;113.662687,23.601458;113.662951,23.601385;113.663980,23.601424;113.664275,23.601445;113.664549,23.601489;113.664596,23.601497;113.664714,23.601497;113.665464,23.601280;113.665655,23.601233;113.665864,23.601202;113.666658,23.601437',\n",
       "         'bustimetag': '0',\n",
       "         'start_time': '0700',\n",
       "         'end_time': '1840',\n",
       "         'via_num': '2',\n",
       "         'via_stops': [{'name': '宣星村委',\n",
       "           'id': '900000111131038',\n",
       "           'location': '113.643294,23.599653'},\n",
       "          {'name': '鸡笼岗路口',\n",
       "           'id': '900000111131040',\n",
       "           'location': '113.661115,23.601975'}]}]},\n",
       "      'entrance': [],\n",
       "      'exit': [],\n",
       "      'railway': {'via_stops': [], 'alters': [], 'spaces': []}},\n",
       "     {'taxi': [],\n",
       "      'walking': {'origin': '113.666656,23.601437',\n",
       "       'destination': '113.667778,23.600882',\n",
       "       'distance': '180',\n",
       "       'duration': '154',\n",
       "       'steps': [{'instruction': '沿龙宣街步行86米右转',\n",
       "         'road': '龙宣街',\n",
       "         'distance': '86',\n",
       "         'duration': [],\n",
       "         'polyline': '113.666656,23.601437;113.666763,23.601467;113.667221,23.601614;113.667458,23.601688',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿龙泉路步行94米',\n",
       "         'road': '龙泉路',\n",
       "         'distance': '94',\n",
       "         'duration': [],\n",
       "         'polyline': '113.667458,23.601688;113.667564,23.601440;113.667671,23.601164;113.667778,23.600882',\n",
       "         'action': [],\n",
       "         'assistant_action': []}]},\n",
       "      'bus': {'buslines': []},\n",
       "      'entrance': [],\n",
       "      'exit': [],\n",
       "      'railway': {'via_stops': [], 'alters': [], 'spaces': []}}]},\n",
       "   {'cost': '4.0',\n",
       "    'duration': '5991',\n",
       "    'nightflag': '0',\n",
       "    'walking_distance': '2957',\n",
       "    'distance': '14702',\n",
       "    'missed': '0',\n",
       "    'segments': [{'taxi': [],\n",
       "      'walking': {'origin': '113.678490,23.633520',\n",
       "       'destination': '113.677689,23.648291',\n",
       "       'distance': '2511',\n",
       "       'duration': '2152',\n",
       "       'steps': [{'instruction': '步行129米左转',\n",
       "         'road': [],\n",
       "         'distance': '129',\n",
       "         'duration': [],\n",
       "         'polyline': '113.678490,23.633520;113.679367,23.634357',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿博学路步行118米左转',\n",
       "         'road': '博学路',\n",
       "         'distance': '118',\n",
       "         'duration': [],\n",
       "         'polyline': '113.679367,23.634357;113.679253,23.634480;113.679062,23.634657;113.678932,23.634762;113.678711,23.634918;113.678635,23.634970;113.678596,23.635031;113.678558,23.635109',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿博学路步行163米右转',\n",
       "         'road': '博学路',\n",
       "         'distance': '163',\n",
       "         'duration': [],\n",
       "         'polyline': '113.678558,23.635109;113.677856,23.635092;113.677612,23.635035;113.677536,23.634996;113.677330,23.634857;113.677086,23.634670',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿博学路步行33米右转',\n",
       "         'road': '博学路',\n",
       "         'distance': '33',\n",
       "         'duration': [],\n",
       "         'polyline': '113.677086,23.634666;113.677025,23.634701;113.676918,23.634718;113.676857,23.634705;113.676796,23.634661',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿中山路步行1265米右转',\n",
       "         'road': '中山路',\n",
       "         'distance': '1265',\n",
       "         'duration': [],\n",
       "         'polyline': '113.676796,23.634657;113.675270,23.636129;113.675156,23.636263;113.675026,23.636467;113.674973,23.636566;113.674957,23.636702;113.674957,23.636845;113.674988,23.636997;113.675385,23.637886;113.675430,23.638042;113.675522,23.638659;113.675522,23.638998;113.675507,23.639132;113.675453,23.639311;113.675331,23.639584;113.675110,23.640036;113.675003,23.640186;113.674316,23.641024;113.673363,23.642139;113.672981,23.642534;113.672173,23.643303;113.671425,23.644045',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿温泉大道步行760米向左前方行走',\n",
       "         'road': '温泉大道',\n",
       "         'distance': '760',\n",
       "         'duration': [],\n",
       "         'polyline': '113.671425,23.644045;113.671638,23.644163;113.673103,23.644970;113.673950,23.645426;113.674370,23.645651;113.675461,23.646276;113.675964,23.646637;113.676407,23.647018;113.677444,23.647964;113.677498,23.648012',\n",
       "         'action': '向左前方行走',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行8米右转',\n",
       "         'road': [],\n",
       "         'distance': '8',\n",
       "         'duration': [],\n",
       "         'polyline': '113.677498,23.648012;113.677444,23.648064',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿温泉大道步行35米到达三层路口',\n",
       "         'road': '温泉大道',\n",
       "         'distance': '35',\n",
       "         'duration': [],\n",
       "         'polyline': '113.677444,23.648069;113.677689,23.648291',\n",
       "         'action': [],\n",
       "         'assistant_action': '到达三层路口'}]},\n",
       "      'bus': {'buslines': [{'departure_stop': {'name': '三层路口',\n",
       "          'id': '900000069254022',\n",
       "          'location': '113.677689,23.648294'},\n",
       "         'arrival_stop': {'name': '宣星路口',\n",
       "          'id': '900000069254026',\n",
       "          'location': '113.628880,23.602548'},\n",
       "         'name': '从12路(吕田客运站总站--从化汽车站总站)',\n",
       "         'id': '900000069254',\n",
       "         'type': '普通公交线路',\n",
       "         'distance': '7791',\n",
       "         'duration': '1292',\n",
       "         'polyline': '113.677689,23.648294;113.677687,23.648290;113.677378,23.648016;113.676372,23.647088;113.675964,23.646745;113.675734,23.646567;113.675464,23.646385;113.675095,23.646172;113.673003,23.645004;113.671771,23.644327;113.671771,23.644323;113.669961,23.643329;113.669162,23.642882;113.668776,23.642674;113.668598,23.642578;113.667001,23.641693;113.666141,23.641172;113.665317,23.640564;113.665252,23.640512;113.665017,23.640299;113.664774,23.640065;113.664549,23.639813;113.664410,23.639661;113.664201,23.639401;113.663928,23.639019;113.663576,23.638451;113.663359,23.638021;113.662322,23.635933;113.661949,23.635182;113.661454,23.634266;113.661224,23.633898;113.660842,23.633381;113.660686,23.633190;113.660252,23.632704;113.659722,23.632170;113.659366,23.631879;113.659258,23.631793;113.658984,23.631589;113.658893,23.631519;113.658212,23.631102;113.657708,23.630760;113.657426,23.630590;113.656984,23.630330;113.656984,23.630326;113.654336,23.628741;113.653850,23.628416;113.653598,23.628225;113.652674,23.627422;113.652370,23.627261;113.652114,23.627062;113.651510,23.626654;113.651363,23.626554;113.651050,23.626315;113.650573,23.625885;113.650091,23.625378;113.649970,23.625269;113.649822,23.625143;113.649766,23.625013;113.648980,23.624384;113.648611,23.624063;113.647843,23.623442;113.647361,23.623090;113.646780,23.622721;113.646345,23.622465;113.645981,23.622287;113.645595,23.622131;113.645117,23.621992;113.644709,23.621914;113.644661,23.621905;113.644669,23.621906;113.644666,23.621905;113.644375,23.621862;113.643255,23.621749;113.642578,23.621667;113.642474,23.621645;113.642027,23.621541;113.641450,23.621354;113.640525,23.621033;113.639332,23.620603;113.639184,23.620543;113.638850,23.620412;113.638472,23.620234;113.638355,23.620174;113.638355,23.620169;113.636046,23.618945;113.635543,23.618668;113.635252,23.618481;113.634748,23.618099;113.634518,23.617891;113.634262,23.617622;113.633980,23.617270;113.633633,23.616780;113.633056,23.615911;113.632917,23.615699;113.632912,23.615699;113.632400,23.614926;113.631910,23.614171;113.631667,23.613711;113.631432,23.613142;113.631293,23.612661;113.630907,23.611076;113.630842,23.610803;113.630825,23.610729;113.630825,23.610725;113.630764,23.610516;113.630660,23.610061;113.630569,23.609705;113.630547,23.609618;113.630495,23.609388;113.630113,23.607821;113.629774,23.606389;113.629392,23.604740;113.628880,23.602548',\n",
       "         'bustimetag': '0',\n",
       "         'start_time': '0630',\n",
       "         'end_time': '1900',\n",
       "         'via_num': '6',\n",
       "         'via_stops': [{'name': '卫东',\n",
       "           'id': '900000069254023',\n",
       "           'location': '113.671771,23.644327'},\n",
       "          {'name': '温泉交警中队',\n",
       "           'id': '900000069254024',\n",
       "           'location': '113.656984,23.630330'},\n",
       "          {'name': '牛步径',\n",
       "           'id': '900000069254041',\n",
       "           'location': '113.644661,23.621905'},\n",
       "          {'name': '华辉度假村',\n",
       "           'id': '900000069254047',\n",
       "           'location': '113.638355,23.620174'},\n",
       "          {'name': '温泉镇政府',\n",
       "           'id': '900000069254025',\n",
       "           'location': '113.632917,23.615699'},\n",
       "          {'name': '云星村站',\n",
       "           'id': '900000069254048',\n",
       "           'location': '113.630825,23.610729'}]},\n",
       "        {'departure_stop': {'name': '三层路口',\n",
       "          'id': '900000069692027',\n",
       "          'location': '113.677597,23.648211'},\n",
       "         'arrival_stop': {'name': '宣星路口',\n",
       "          'id': '900000069692030',\n",
       "          'location': '113.628841,23.602378'},\n",
       "         'name': '从11路(良口客运站总站--从化汽车站总站)',\n",
       "         'id': '900000069692',\n",
       "         'type': '普通公交线路',\n",
       "         'distance': '7672',\n",
       "         'duration': '1288',\n",
       "         'polyline': '113.677597,23.648211;113.677376,23.648016;113.676376,23.647089;113.675964,23.646744;113.675735,23.646566;113.675468,23.646385;113.675095,23.646172;113.674744,23.645973;113.673363,23.645201;113.673004,23.645004;113.671715,23.644299;113.671715,23.644293;113.670654,23.643707;113.669968,23.643330;113.668770,23.642673;113.668594,23.642578;113.667007,23.641693;113.666145,23.641171;113.665314,23.640564;113.665253,23.640511;113.665016,23.640301;113.664772,23.640064;113.664551,23.639812;113.664406,23.639662;113.664207,23.639400;113.663925,23.639021;113.663574,23.638451;113.663361,23.638020;113.662323,23.635933;113.661949,23.635181;113.661461,23.634266;113.661224,23.633898;113.660843,23.633383;113.660683,23.633192;113.660278,23.632727;113.659721,23.632172;113.659370,23.631880;113.659256,23.631794;113.658989,23.631588;113.658897,23.631519;113.658226,23.631102;113.657707,23.630760;113.657425,23.630590;113.657120,23.630413;113.657118,23.630408;113.654336,23.628741;113.653850,23.628416;113.653598,23.628225;113.652674,23.627422;113.650165,23.625326;113.650022,23.625221;113.649766,23.625013;113.648924,23.624327;113.647843,23.623442;113.647361,23.623090;113.646780,23.622721;113.646345,23.622465;113.645981,23.622287;113.645595,23.622131;113.645117,23.621992;113.644709,23.621914;113.644414,23.621871;113.644410,23.621871;113.644375,23.621862;113.643255,23.621749;113.642578,23.621667;113.642474,23.621645;113.642027,23.621541;113.641450,23.621354;113.640525,23.621033;113.639332,23.620603;113.639184,23.620543;113.638850,23.620412;113.638433,23.620213;113.638329,23.620156;113.638325,23.620156;113.636046,23.618945;113.635543,23.618668;113.635252,23.618481;113.634748,23.618099;113.634518,23.617891;113.634262,23.617622;113.633980,23.617270;113.633633,23.616780;113.633056,23.615911;113.632960,23.615768;113.632960,23.615764;113.632400,23.614926;113.631910,23.614171;113.631667,23.613711;113.631432,23.613142;113.631293,23.612661;113.630907,23.611076;113.630842,23.610803;113.630829,23.610747;113.630729,23.610373;113.630660,23.610061;113.630569,23.609705;113.630547,23.609618;113.630495,23.609388;113.630113,23.607821;113.629774,23.606389;113.629392,23.604740;113.628841,23.602378',\n",
       "         'bustimetag': '0',\n",
       "         'start_time': '0630',\n",
       "         'end_time': '1930',\n",
       "         'via_num': '6',\n",
       "         'via_stops': [{'name': '卫东',\n",
       "           'id': '900000069692010',\n",
       "           'location': '113.671715,23.644299'},\n",
       "          {'name': '温泉交警中队',\n",
       "           'id': '900000069692011',\n",
       "           'location': '113.657120,23.630413'},\n",
       "          {'name': '牛步迳',\n",
       "           'id': '900000069692028',\n",
       "           'location': '113.644414,23.621871'},\n",
       "          {'name': '华辉度假村',\n",
       "           'id': '900000069692038',\n",
       "           'location': '113.638329,23.620156'},\n",
       "          {'name': '温泉镇政府',\n",
       "           'id': '900000069692029',\n",
       "           'location': '113.632960,23.615768'},\n",
       "          {'name': '云星村',\n",
       "           'id': '900000069692039',\n",
       "           'location': '113.630829,23.610747'}]}]},\n",
       "      'entrance': [],\n",
       "      'exit': [],\n",
       "      'railway': {'via_stops': [], 'alters': [], 'spaces': []}},\n",
       "     {'taxi': [],\n",
       "      'walking': {'origin': '113.628883,23.602552',\n",
       "       'destination': '113.628723,23.601267',\n",
       "       'distance': '266',\n",
       "       'duration': '228',\n",
       "       'steps': [{'instruction': '沿温泉大道步行55米右转',\n",
       "         'road': '温泉大道',\n",
       "         'distance': '55',\n",
       "         'duration': [],\n",
       "         'polyline': '113.628883,23.602552;113.628998,23.603046',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行13米右转',\n",
       "         'road': [],\n",
       "         'distance': '13',\n",
       "         'duration': [],\n",
       "         'polyline': '113.629005,23.603046;113.629120,23.603025',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿温泉大道步行198米到达宣星路口',\n",
       "         'road': '温泉大道',\n",
       "         'distance': '198',\n",
       "         'duration': [],\n",
       "         'polyline': '113.629120,23.603022;113.628906,23.602083;113.628815,23.601658;113.628723,23.601267',\n",
       "         'action': [],\n",
       "         'assistant_action': '到达宣星路口'}]},\n",
       "      'bus': {'buslines': [{'departure_stop': {'name': '宣星路口',\n",
       "          'id': '900000111131022',\n",
       "          'location': '113.628720,23.601263'},\n",
       "         'arrival_stop': {'name': '教师村',\n",
       "          'id': '900000111131041',\n",
       "          'location': '113.666658,23.601437'},\n",
       "         'name': '从14路(从化汽车站总站--高坣总站)',\n",
       "         'id': '900000111131',\n",
       "         'type': '普通公交线路',\n",
       "         'distance': '3954',\n",
       "         'duration': '2165',\n",
       "         'polyline': '113.628720,23.601263;113.628720,23.601259;113.628811,23.601658;113.629280,23.601780;113.630113,23.601445;113.630365,23.601354;113.632248,23.600681;113.633785,23.600347;113.635725,23.599957;113.636810,23.599731;113.637335,23.599657;113.638103,23.599596;113.638542,23.599579;113.639266,23.599588;113.639427,23.599592;113.642270,23.599570;113.642578,23.599570;113.643043,23.599622;113.643294,23.599653;113.643290,23.599653;113.643581,23.599688;113.643624,23.599661;113.643911,23.599657;113.644232,23.599605;113.644449,23.599614;113.645451,23.599935;113.646454,23.600278;113.646589,23.600347;113.646658,23.600417;113.646931,23.600595;113.649835,23.601749;113.649935,23.601797;113.650030,23.601862;113.650937,23.602674;113.651063,23.602752;113.651176,23.602786;113.651367,23.602826;113.651584,23.602847;113.651845,23.602847;113.652001,23.602830;113.652504,23.602708;113.652839,23.602582;113.652999,23.602548;113.653181,23.602543;113.653264,23.602561;113.653659,23.602752;113.653802,23.602799;113.654605,23.602977;113.655122,23.603069;113.655243,23.603077;113.655391,23.603069;113.655799,23.602999;113.656055,23.602934;113.656302,23.602847;113.657083,23.602530;113.657300,23.602461;113.657500,23.602418;113.659041,23.602205;113.659501,23.602144;113.660009,23.602170;113.660386,23.602144;113.661046,23.601988;113.661115,23.601975;113.661115,23.601970;113.661115,23.601975;113.661845,23.601801;113.662044,23.601740;113.662687,23.601458;113.662951,23.601385;113.663980,23.601424;113.664275,23.601445;113.664549,23.601489;113.664596,23.601497;113.664714,23.601497;113.665464,23.601280;113.665655,23.601233;113.665864,23.601202;113.666658,23.601437',\n",
       "         'bustimetag': '0',\n",
       "         'start_time': '0700',\n",
       "         'end_time': '1840',\n",
       "         'via_num': '2',\n",
       "         'via_stops': [{'name': '宣星村委',\n",
       "           'id': '900000111131038',\n",
       "           'location': '113.643294,23.599653'},\n",
       "          {'name': '鸡笼岗路口',\n",
       "           'id': '900000111131040',\n",
       "           'location': '113.661115,23.601975'}]}]},\n",
       "      'entrance': [],\n",
       "      'exit': [],\n",
       "      'railway': {'via_stops': [], 'alters': [], 'spaces': []}},\n",
       "     {'taxi': [],\n",
       "      'walking': {'origin': '113.666656,23.601437',\n",
       "       'destination': '113.667778,23.600882',\n",
       "       'distance': '180',\n",
       "       'duration': '154',\n",
       "       'steps': [{'instruction': '沿龙宣街步行86米右转',\n",
       "         'road': '龙宣街',\n",
       "         'distance': '86',\n",
       "         'duration': [],\n",
       "         'polyline': '113.666656,23.601437;113.666763,23.601467;113.667221,23.601614;113.667458,23.601688',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿龙泉路步行94米',\n",
       "         'road': '龙泉路',\n",
       "         'distance': '94',\n",
       "         'duration': [],\n",
       "         'polyline': '113.667458,23.601688;113.667564,23.601440;113.667671,23.601164;113.667778,23.600882',\n",
       "         'action': [],\n",
       "         'assistant_action': []}]},\n",
       "      'bus': {'buslines': []},\n",
       "      'entrance': [],\n",
       "      'exit': [],\n",
       "      'railway': {'via_stops': [], 'alters': [], 'spaces': []}}]},\n",
       "   {'cost': '4.0',\n",
       "    'duration': '6190',\n",
       "    'nightflag': '0',\n",
       "    'walking_distance': '642',\n",
       "    'distance': '24135',\n",
       "    'missed': '0',\n",
       "    'segments': [{'taxi': [],\n",
       "      'walking': {'origin': '113.678581,23.633133',\n",
       "       'destination': '113.676613,23.631285',\n",
       "       'distance': '518',\n",
       "       'duration': '444',\n",
       "       'steps': [{'instruction': '步行53米左转',\n",
       "         'road': [],\n",
       "         'distance': '53',\n",
       "         'duration': [],\n",
       "         'polyline': '113.678581,23.633133;113.678627,23.633081;113.678619,23.633038;113.678452,23.632895;113.678421,23.632877;113.678360,23.632877;113.678307,23.632921',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行113米右转',\n",
       "         'road': [],\n",
       "         'distance': '113',\n",
       "         'duration': [],\n",
       "         'polyline': '113.678307,23.632921;113.677582,23.632309;113.677559,23.632278;113.677551,23.632200',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行161米左转',\n",
       "         'road': [],\n",
       "         'distance': '161',\n",
       "         'duration': [],\n",
       "         'polyline': '113.677544,23.632196;113.677399,23.632179;113.677284,23.632200;113.677177,23.632244;113.677017,23.632357;113.676811,23.632534;113.676582,23.632778;113.676430,23.632904;113.676292,23.632969',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿博学路步行191米到达中大南方学院',\n",
       "         'road': '博学路',\n",
       "         'distance': '191',\n",
       "         'duration': [],\n",
       "         'polyline': '113.676285,23.632969;113.676292,23.632227;113.676338,23.631948;113.676430,23.631676;113.676491,23.631540;113.676613,23.631285',\n",
       "         'action': [],\n",
       "         'assistant_action': '到达中大南方学院'}]},\n",
       "      'bus': {'buslines': [{'departure_stop': {'name': '中大南方学院',\n",
       "          'id': '900000111141002',\n",
       "          'location': '113.676613,23.631281'},\n",
       "         'arrival_stop': {'name': '沙塱村',\n",
       "          'id': '900000111141015',\n",
       "          'location': '113.615547,23.557409'},\n",
       "         'name': '从15路(中大南方学院--从化汽车站总站)',\n",
       "         'id': '900000111141',\n",
       "         'type': '普通公交线路',\n",
       "         'distance': '15234',\n",
       "         'duration': '2846',\n",
       "         'polyline': '113.676613,23.631281;113.676460,23.631588;113.676430,23.631672;113.676338,23.631945;113.676292,23.632223;113.676285,23.632969;113.676285,23.633560;113.676300,23.633738;113.676331,23.633875;113.676399,23.634016;113.676460,23.634111;113.676521,23.634193;113.676781,23.634409;113.676857,23.634357;113.676933,23.634340;113.677032,23.634354;113.677094,23.634396;113.677139,23.634459;113.677147,23.634535;113.677139,23.634600;113.677086,23.634663;113.677032,23.634701;113.676918,23.634718;113.676857,23.634701;113.676788,23.634657;113.675262,23.636129;113.675156,23.636263;113.675026,23.636467;113.674973,23.636566;113.674957,23.636702;113.674957,23.636845;113.674995,23.636995;113.675377,23.637886;113.675430,23.638042;113.675522,23.638659;113.675529,23.638998;113.675514,23.639132;113.675446,23.639311;113.675331,23.639582;113.675102,23.640036;113.675003,23.640186;113.674309,23.641024;113.673347,23.642139;113.672981,23.642536;113.672935,23.642578;113.672173,23.643307;113.671707,23.643766;113.671432,23.644045;113.673103,23.644968;113.674362,23.645651;113.675461,23.646276;113.675964,23.646635;113.676407,23.647018;113.676376,23.647089;113.675964,23.646744;113.675735,23.646566;113.675468,23.646385;113.675095,23.646172;113.673004,23.645004;113.669968,23.643330;113.669167,23.642881;113.668770,23.642673;113.668594,23.642578;113.667007,23.641693;113.666145,23.641171;113.665314,23.640564;113.665253,23.640511;113.665016,23.640301;113.664772,23.640064;113.664551,23.639812;113.664406,23.639662;113.664207,23.639400;113.663925,23.639021;113.663574,23.638451;113.663361,23.638020;113.662323,23.635933;113.661949,23.635181;113.661461,23.634266;113.661224,23.633898;113.660843,23.633383;113.660683,23.633192;113.660248,23.632704;113.659721,23.632172;113.659370,23.631880;113.659256,23.631794;113.658989,23.631588;113.658897,23.631519;113.658211,23.631102;113.657707,23.630760;113.657425,23.630590;113.656944,23.630304;113.656940,23.630304;113.654336,23.628741;113.653850,23.628416;113.653598,23.628225;113.652383,23.627179;113.650165,23.625326;113.650022,23.625221;113.649766,23.625013;113.649731,23.624987;113.649731,23.624983;113.648980,23.624384;113.648611,23.624063;113.647843,23.623442;113.647361,23.623090;113.646780,23.622721;113.646345,23.622465;113.645981,23.622287;113.645595,23.622131;113.645117,23.621992;113.644709,23.621914;113.644640,23.621901;113.644635,23.621901;113.644375,23.621862;113.643255,23.621749;113.642578,23.621667;113.642474,23.621645;113.642027,23.621541;113.641450,23.621354;113.640525,23.621033;113.639332,23.620603;113.639184,23.620543;113.638850,23.620412;113.638433,23.620213;113.638325,23.620156;113.638329,23.620155;113.636047,23.618944;113.635544,23.618668;113.635254,23.618481;113.634750,23.618097;113.634514,23.617891;113.634254,23.617622;113.633980,23.617271;113.633636,23.616779;113.633057,23.615911;113.632957,23.615774;113.632401,23.614927;113.631912,23.614172;113.631660,23.613710;113.631432,23.613142;113.631287,23.612659;113.630905,23.611076;113.630844,23.610802;113.630844,23.610798;113.630768,23.610516;113.630661,23.610060;113.630569,23.609705;113.630554,23.609617;113.630501,23.609388;113.630119,23.607822;113.629776,23.606388;113.629395,23.604740;113.628891,23.602587;113.628479,23.600821;113.628136,23.599293;113.627968,23.598680;113.627953,23.598633;113.627884,23.598433;113.627785,23.598202;113.627632,23.597919;113.627487,23.597683;113.627281,23.597401;113.627037,23.597139;113.626106,23.596230;113.625641,23.595755;113.624992,23.595139;113.624092,23.594326;113.623161,23.593433;113.622879,23.593147;113.622734,23.592981;113.622383,23.592590;113.622055,23.592186;113.621872,23.591957;113.621574,23.591545;113.621292,23.591133;113.621117,23.590864;113.620880,23.590433;113.620735,23.590164;113.620674,23.590054;113.620673,23.590052;113.620603,23.589913;113.619475,23.587643;113.619401,23.587491;113.619401,23.587487;113.619175,23.587040;113.618984,23.586658;113.618893,23.586471;113.618598,23.585868;113.618108,23.584874;113.617930,23.584440;113.617769,23.583928;113.617708,23.583646;113.617630,23.583073;113.617582,23.582478;113.617578,23.582357;113.617578,23.582361;113.617584,23.582365;113.617584,23.582359;113.617554,23.581884;113.617485,23.580811;113.617477,23.580591;113.617485,23.580204;113.617493,23.579849;113.617554,23.579384;113.617668,23.578743;113.617760,23.578316;113.617790,23.578138;113.618042,23.576904;113.618080,23.576723;113.618095,23.576658;113.618118,23.576557;113.618187,23.576189;113.618347,23.575378;113.618416,23.574808;113.618423,23.574497;113.618408,23.574158;113.618286,23.573481;113.618263,23.573381;113.618210,23.573103;113.618210,23.573111;113.618210,23.573120;113.618210,23.573116;113.618172,23.572929;113.618080,23.572432;113.618034,23.572153;113.618011,23.571901;113.617989,23.571444;113.618034,23.570911;113.618187,23.569813;113.618332,23.568825;113.618462,23.567951;113.618652,23.566698;113.618759,23.565947;113.618790,23.565674;113.618828,23.565474;113.618843,23.565365;113.618874,23.565182;113.618896,23.565014;113.618896,23.564964;113.619118,23.563465;113.619171,23.563156;113.619263,23.562523;113.619286,23.562109;113.619263,23.561775;113.619232,23.561602;113.619171,23.561384;113.619011,23.561010;113.618790,23.560673;113.618652,23.560495;113.618149,23.559973;113.617950,23.559765;113.616966,23.558811;113.615730,23.557600;113.615547,23.557409',\n",
       "         'bustimetag': '0',\n",
       "         'start_time': '0900',\n",
       "         'end_time': '1800',\n",
       "         'via_num': '12',\n",
       "         'via_stops': [{'name': '卫东',\n",
       "           'id': '900000111141003',\n",
       "           'location': '113.671707,23.643766'},\n",
       "          {'name': '交警温泉中队',\n",
       "           'id': '900000111141029',\n",
       "           'location': '113.656944,23.630304'},\n",
       "          {'name': '冲口',\n",
       "           'id': '900000111141022',\n",
       "           'location': '113.649731,23.624987'},\n",
       "          {'name': '牛步迳',\n",
       "           'id': '900000111141006',\n",
       "           'location': '113.644640,23.621901'},\n",
       "          {'name': '华辉度假村',\n",
       "           'id': '900000111141023',\n",
       "           'location': '113.638325,23.620156'},\n",
       "          {'name': '温泉镇政府',\n",
       "           'id': '900000111141008',\n",
       "           'location': '113.632957,23.615774'},\n",
       "          {'name': '云星村',\n",
       "           'id': '900000111141024',\n",
       "           'location': '113.630844,23.610802'},\n",
       "          {'name': '宣星路口',\n",
       "           'id': '900000111141010',\n",
       "           'location': '113.628891,23.602587'},\n",
       "          {'name': '新华',\n",
       "           'id': '900000111141011',\n",
       "           'location': '113.620674,23.590054'},\n",
       "          {'name': '水底村',\n",
       "           'id': '900000111141012',\n",
       "           'location': '113.619401,23.587491'},\n",
       "          {'name': '南洋学院',\n",
       "           'id': '900000111141028',\n",
       "           'location': '113.617578,23.582357'},\n",
       "          {'name': '江埔社区',\n",
       "           'id': '900000111141014',\n",
       "           'location': '113.618210,23.573103'}]}]},\n",
       "      'entrance': [],\n",
       "      'exit': [],\n",
       "      'railway': {'via_stops': [], 'alters': [], 'spaces': []}},\n",
       "     {'taxi': [],\n",
       "      'walking': {'origin': '113.615540,23.557413',\n",
       "       'destination': '113.615593,23.557280',\n",
       "       'distance': '65',\n",
       "       'duration': '55',\n",
       "       'steps': [{'instruction': '沿环市东路步行22米右转',\n",
       "         'road': '环市东路',\n",
       "         'distance': '22',\n",
       "         'duration': [],\n",
       "         'polyline': '113.615540,23.557413;113.615692,23.557562',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行14米右转',\n",
       "         'road': [],\n",
       "         'distance': '14',\n",
       "         'duration': [],\n",
       "         'polyline': '113.615692,23.557562;113.615791,23.557474',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿环市东路步行29米到达沙塱村',\n",
       "         'road': '环市东路',\n",
       "         'distance': '29',\n",
       "         'duration': [],\n",
       "         'polyline': '113.615791,23.557470;113.615593,23.557280',\n",
       "         'action': [],\n",
       "         'assistant_action': '到达沙塱村'}]},\n",
       "      'bus': {'buslines': [{'departure_stop': {'name': '沙塱村',\n",
       "          'id': '900000111136007',\n",
       "          'location': '113.615593,23.557278'},\n",
       "         'arrival_stop': {'name': '龙岗墟',\n",
       "          'id': '900000111136028',\n",
       "          'location': '113.668082,23.600477'},\n",
       "         'name': '从19路(从化汽车站总站--高坣总站)',\n",
       "         'id': '900000111136',\n",
       "         'type': '普通公交线路',\n",
       "         'distance': '8259',\n",
       "         'duration': '2794',\n",
       "         'polyline': '113.615593,23.557278;113.615590,23.557274;113.617622,23.559266;113.618247,23.559887;113.618555,23.559796;113.618976,23.559753;113.619180,23.559727;113.619423,23.559740;113.619575,23.559753;113.620221,23.559922;113.620603,23.560009;113.621510,23.560221;113.621766,23.560312;113.621936,23.560417;113.622044,23.560521;113.622652,23.561181;113.622995,23.561589;113.623212,23.561766;113.623490,23.561905;113.624427,23.562179;113.624983,23.562361;113.625955,23.562678;113.626250,23.562804;113.626567,23.562999;113.627409,23.563646;113.627565,23.563811;113.627656,23.563945;113.628060,23.564588;113.628260,23.565022;113.628355,23.565169;113.628924,23.565673;113.629058,23.565794;113.629588,23.566454;113.630109,23.566879;113.630451,23.567153;113.630742,23.567383;113.630877,23.567470;113.631085,23.567652;113.631220,23.567830;113.631328,23.568047;113.631367,23.568147;113.631441,23.568333;113.631697,23.568993;113.631793,23.569154;113.631853,23.569219;113.631988,23.569314;113.632374,23.569488;113.632773,23.569631;113.633060,23.569683;113.633247,23.569688;113.633372,23.569679;113.633368,23.569683;113.633485,23.569674;113.633746,23.569614;113.635330,23.569058;113.636593,23.568641;113.636832,23.568581;113.637205,23.568516;113.637426,23.568503;113.637695,23.568524;113.638047,23.568607;113.638390,23.568741;113.638637,23.568867;113.638633,23.568867;113.638898,23.569002;113.640399,23.569818;113.640647,23.569974;113.640859,23.570152;113.640955,23.570256;113.641163,23.570521;113.641428,23.570816;113.641632,23.570998;113.641970,23.571224;113.642322,23.571406;113.642543,23.571497;113.642578,23.571506;113.642930,23.571628;113.643043,23.571649;113.643286,23.571680;113.643503,23.571680;113.643628,23.571680;113.643624,23.571680;113.643967,23.571675;113.644614,23.571671;113.644878,23.571701;113.644970,23.571727;113.645247,23.571862;113.645959,23.572365;113.646198,23.572561;113.646415,23.572773;113.646606,23.572956;113.646788,23.573151;113.647274,23.573637;113.647405,23.573750;113.649232,23.575178;113.649575,23.575447;113.649618,23.575486;113.649618,23.575482;113.649674,23.575530;113.650378,23.576089;113.651076,23.576658;113.651432,23.576936;113.651649,23.577105;113.652001,23.577383;113.652448,23.577700;113.652704,23.577860;113.653177,23.578108;113.653173,23.578108;113.653429,23.578242;113.653676,23.578368;113.654562,23.578845;113.654913,23.579019;113.655091,23.579084;113.656050,23.579310;113.656411,23.579358;113.656589,23.579484;113.656723,23.579640;113.657235,23.580213;113.657292,23.580304;113.657396,23.580612;113.657431,23.580773;113.657483,23.582105;113.657483,23.582231;113.657470,23.582339;113.657431,23.582439;113.657378,23.582539;113.657157,23.582847;113.657066,23.583025;113.656979,23.583255;113.656888,23.583568;113.656871,23.583676;113.656879,23.583780;113.656905,23.583919;113.657062,23.584449;113.657114,23.584566;113.657322,23.584891;113.657478,23.585156;113.657548,23.585365;113.657691,23.586688;113.657743,23.586931;113.657813,23.587135;113.658021,23.587643;113.658099,23.587830;113.658095,23.587830;113.658750,23.589397;113.658819,23.589588;113.659110,23.590226;113.659622,23.591046;113.659826,23.591389;113.659926,23.591589;113.660456,23.592799;113.660543,23.593021;113.660725,23.593594;113.660825,23.593885;113.660903,23.594028;113.660990,23.594167;113.660990,23.594171;113.660990,23.594167;113.661141,23.594410;113.661306,23.594601;113.661554,23.594844;113.662235,23.595430;113.663477,23.596506;113.663737,23.596775;113.664067,23.597135;113.664392,23.597617;113.664549,23.597865;113.664792,23.598234;113.665122,23.598633;113.665252,23.598780;113.665282,23.598819;113.665512,23.599089;113.665777,23.599362;113.665951,23.599501;113.666224,23.599640;113.667322,23.600135;113.667943,23.600412;113.668082,23.600477',\n",
       "         'bustimetag': '0',\n",
       "         'start_time': '0700',\n",
       "         'end_time': '1800',\n",
       "         'via_num': '9',\n",
       "         'via_stops': [{'name': '灌村路口',\n",
       "           'id': '900000111136045',\n",
       "           'location': '113.618976,23.559753'},\n",
       "          {'name': '福上下社1',\n",
       "           'id': '900000111136037',\n",
       "           'location': '113.631367,23.568147'},\n",
       "          {'name': '福上下社2',\n",
       "           'id': '900000111136038',\n",
       "           'location': '113.633372,23.569679'},\n",
       "          {'name': '石海村',\n",
       "           'id': '900000111136039',\n",
       "           'location': '113.638637,23.568867'},\n",
       "          {'name': '石海小学',\n",
       "           'id': '900000111136040',\n",
       "           'location': '113.643628,23.571680'},\n",
       "          {'name': '石海村委',\n",
       "           'id': '900000111136041',\n",
       "           'location': '113.649618,23.575486'},\n",
       "          {'name': '灌村围',\n",
       "           'id': '900000111136042',\n",
       "           'location': '113.653177,23.578108'},\n",
       "          {'name': '中田里',\n",
       "           'id': '900000111136047',\n",
       "           'location': '113.658099,23.587830'},\n",
       "          {'name': '石桥社',\n",
       "           'id': '900000111136043',\n",
       "           'location': '113.660990,23.594167'}]}]},\n",
       "      'entrance': [],\n",
       "      'exit': [],\n",
       "      'railway': {'via_stops': [], 'alters': [], 'spaces': []}},\n",
       "     {'taxi': [],\n",
       "      'walking': {'origin': '113.668083,23.600477',\n",
       "       'destination': '113.667816,23.600794',\n",
       "       'distance': '59',\n",
       "       'duration': '50',\n",
       "       'steps': [{'instruction': '沿桃园东路步行15米右转',\n",
       "         'road': '桃园东路',\n",
       "         'distance': '15',\n",
       "         'duration': [],\n",
       "         'polyline': '113.668083,23.600477;113.667946,23.600416',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿龙泉路步行44米',\n",
       "         'road': '龙泉路',\n",
       "         'distance': '44',\n",
       "         'duration': [],\n",
       "         'polyline': '113.667946,23.600412;113.667816,23.600794',\n",
       "         'action': [],\n",
       "         'assistant_action': []}]},\n",
       "      'bus': {'buslines': []},\n",
       "      'entrance': [],\n",
       "      'exit': [],\n",
       "      'railway': {'via_stops': [], 'alters': [], 'spaces': []}}]},\n",
       "   {'cost': '4.0',\n",
       "    'duration': '6971',\n",
       "    'nightflag': '0',\n",
       "    'walking_distance': '2634',\n",
       "    'distance': '23756',\n",
       "    'missed': '0',\n",
       "    'segments': [{'taxi': [],\n",
       "      'walking': {'origin': '113.678490,23.633520',\n",
       "       'destination': '113.677689,23.648291',\n",
       "       'distance': '2511',\n",
       "       'duration': '2152',\n",
       "       'steps': [{'instruction': '步行129米左转',\n",
       "         'road': [],\n",
       "         'distance': '129',\n",
       "         'duration': [],\n",
       "         'polyline': '113.678490,23.633520;113.679367,23.634357',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿博学路步行118米左转',\n",
       "         'road': '博学路',\n",
       "         'distance': '118',\n",
       "         'duration': [],\n",
       "         'polyline': '113.679367,23.634357;113.679253,23.634480;113.679062,23.634657;113.678932,23.634762;113.678711,23.634918;113.678635,23.634970;113.678596,23.635031;113.678558,23.635109',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿博学路步行163米右转',\n",
       "         'road': '博学路',\n",
       "         'distance': '163',\n",
       "         'duration': [],\n",
       "         'polyline': '113.678558,23.635109;113.677856,23.635092;113.677612,23.635035;113.677536,23.634996;113.677330,23.634857;113.677086,23.634670',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿博学路步行33米右转',\n",
       "         'road': '博学路',\n",
       "         'distance': '33',\n",
       "         'duration': [],\n",
       "         'polyline': '113.677086,23.634666;113.677025,23.634701;113.676918,23.634718;113.676857,23.634705;113.676796,23.634661',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿中山路步行1265米右转',\n",
       "         'road': '中山路',\n",
       "         'distance': '1265',\n",
       "         'duration': [],\n",
       "         'polyline': '113.676796,23.634657;113.675270,23.636129;113.675156,23.636263;113.675026,23.636467;113.674973,23.636566;113.674957,23.636702;113.674957,23.636845;113.674988,23.636997;113.675385,23.637886;113.675430,23.638042;113.675522,23.638659;113.675522,23.638998;113.675507,23.639132;113.675453,23.639311;113.675331,23.639584;113.675110,23.640036;113.675003,23.640186;113.674316,23.641024;113.673363,23.642139;113.672981,23.642534;113.672173,23.643303;113.671425,23.644045',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿温泉大道步行760米向左前方行走',\n",
       "         'road': '温泉大道',\n",
       "         'distance': '760',\n",
       "         'duration': [],\n",
       "         'polyline': '113.671425,23.644045;113.671638,23.644163;113.673103,23.644970;113.673950,23.645426;113.674370,23.645651;113.675461,23.646276;113.675964,23.646637;113.676407,23.647018;113.677444,23.647964;113.677498,23.648012',\n",
       "         'action': '向左前方行走',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行8米右转',\n",
       "         'road': [],\n",
       "         'distance': '8',\n",
       "         'duration': [],\n",
       "         'polyline': '113.677498,23.648012;113.677444,23.648064',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿温泉大道步行35米到达三层路口',\n",
       "         'road': '温泉大道',\n",
       "         'distance': '35',\n",
       "         'duration': [],\n",
       "         'polyline': '113.677444,23.648069;113.677689,23.648291',\n",
       "         'action': [],\n",
       "         'assistant_action': '到达三层路口'}]},\n",
       "      'bus': {'buslines': [{'departure_stop': {'name': '三层路口',\n",
       "          'id': '900000069692027',\n",
       "          'location': '113.677597,23.648211'},\n",
       "         'arrival_stop': {'name': '沙塱村',\n",
       "          'id': '900000069692017',\n",
       "          'location': '113.615556,23.557422'},\n",
       "         'name': '从11路(良口客运站总站--从化汽车站总站)',\n",
       "         'id': '900000069692',\n",
       "         'type': '普通公交线路',\n",
       "         'distance': '12863',\n",
       "         'duration': '1920',\n",
       "         'polyline': '113.677597,23.648211;113.677376,23.648016;113.676376,23.647089;113.675964,23.646744;113.675735,23.646566;113.675468,23.646385;113.675095,23.646172;113.674744,23.645973;113.673363,23.645201;113.673004,23.645004;113.671715,23.644299;113.671715,23.644293;113.670654,23.643707;113.669968,23.643330;113.668770,23.642673;113.668594,23.642578;113.667007,23.641693;113.666145,23.641171;113.665314,23.640564;113.665253,23.640511;113.665016,23.640301;113.664772,23.640064;113.664551,23.639812;113.664406,23.639662;113.664207,23.639400;113.663925,23.639021;113.663574,23.638451;113.663361,23.638020;113.662323,23.635933;113.661949,23.635181;113.661461,23.634266;113.661224,23.633898;113.660843,23.633383;113.660683,23.633192;113.660278,23.632727;113.659721,23.632172;113.659370,23.631880;113.659256,23.631794;113.658989,23.631588;113.658897,23.631519;113.658226,23.631102;113.657707,23.630760;113.657425,23.630590;113.657120,23.630413;113.657118,23.630408;113.654336,23.628741;113.653850,23.628416;113.653598,23.628225;113.652674,23.627422;113.650165,23.625326;113.650022,23.625221;113.649766,23.625013;113.648924,23.624327;113.647843,23.623442;113.647361,23.623090;113.646780,23.622721;113.646345,23.622465;113.645981,23.622287;113.645595,23.622131;113.645117,23.621992;113.644709,23.621914;113.644414,23.621871;113.644410,23.621871;113.644375,23.621862;113.643255,23.621749;113.642578,23.621667;113.642474,23.621645;113.642027,23.621541;113.641450,23.621354;113.640525,23.621033;113.639332,23.620603;113.639184,23.620543;113.638850,23.620412;113.638433,23.620213;113.638329,23.620156;113.638325,23.620156;113.636046,23.618945;113.635543,23.618668;113.635252,23.618481;113.634748,23.618099;113.634518,23.617891;113.634262,23.617622;113.633980,23.617270;113.633633,23.616780;113.633056,23.615911;113.632960,23.615768;113.632960,23.615764;113.632400,23.614926;113.631910,23.614171;113.631667,23.613711;113.631432,23.613142;113.631293,23.612661;113.630907,23.611076;113.630842,23.610803;113.630829,23.610747;113.630729,23.610373;113.630660,23.610061;113.630569,23.609705;113.630547,23.609618;113.630495,23.609388;113.630113,23.607821;113.629774,23.606389;113.629392,23.604740;113.628841,23.602378;113.628841,23.602374;113.628477,23.600820;113.628134,23.599293;113.627969,23.598681;113.627951,23.598633;113.627882,23.598433;113.627782,23.598203;113.627635,23.597921;113.627487,23.597682;113.627279,23.597400;113.627040,23.597140;113.626102,23.596228;113.625647,23.595755;113.624996,23.595139;113.624089,23.594327;113.623164,23.593433;113.622882,23.593147;113.622734,23.592982;113.622378,23.592591;113.622053,23.592188;113.621875,23.591957;113.621693,23.591706;113.621688,23.591706;113.621576,23.591545;113.621289,23.591133;113.621124,23.590864;113.620734,23.590165;113.620603,23.589913;113.619475,23.587643;113.619384,23.587461;113.619384,23.587457;113.619175,23.587040;113.618984,23.586658;113.618893,23.586471;113.618598,23.585868;113.618108,23.584874;113.617930,23.584440;113.617769,23.583928;113.617708,23.583646;113.617630,23.583073;113.617582,23.582478;113.617578,23.582387;113.617578,23.582383;113.617552,23.581884;113.617474,23.580651;113.617474,23.580590;113.617474,23.580516;113.617483,23.580204;113.617496,23.579848;113.617556,23.579384;113.617674,23.578741;113.617760,23.578316;113.617791,23.578138;113.618043,23.576905;113.618082,23.576723;113.618095,23.576658;113.618116,23.576558;113.618190,23.576189;113.618346,23.575378;113.618420,23.574809;113.618424,23.574497;113.618407,23.574158;113.618281,23.573481;113.618264,23.573381;113.618229,23.573194;113.618229,23.573190;113.618134,23.572730;113.618077,23.572431;113.618034,23.572153;113.618008,23.571901;113.617990,23.571445;113.618034,23.570911;113.618155,23.570013;113.618190,23.569787;113.618312,23.568967;113.618333,23.568824;113.618464,23.567951;113.618485,23.567786;113.618646,23.566697;113.618759,23.565946;113.618793,23.565673;113.618828,23.565473;113.618845,23.565365;113.618872,23.565182;113.618893,23.565013;113.618902,23.564965;113.619123,23.563464;113.619175,23.563155;113.619188,23.563064;113.619262,23.562522;113.619288,23.562109;113.619262,23.561775;113.619232,23.561602;113.619171,23.561385;113.619010,23.561011;113.618793,23.560673;113.618646,23.560495;113.618142,23.559970;113.617943,23.559766;113.616970,23.558819;113.615729,23.557600;113.615556,23.557422',\n",
       "         'bustimetag': '0',\n",
       "         'start_time': '0630',\n",
       "         'end_time': '1930',\n",
       "         'via_num': '13',\n",
       "         'via_stops': [{'name': '卫东',\n",
       "           'id': '900000069692010',\n",
       "           'location': '113.671715,23.644299'},\n",
       "          {'name': '温泉交警中队',\n",
       "           'id': '900000069692011',\n",
       "           'location': '113.657120,23.630413'},\n",
       "          {'name': '牛步迳',\n",
       "           'id': '900000069692028',\n",
       "           'location': '113.644414,23.621871'},\n",
       "          {'name': '华辉度假村',\n",
       "           'id': '900000069692038',\n",
       "           'location': '113.638329,23.620156'},\n",
       "          {'name': '温泉镇政府',\n",
       "           'id': '900000069692029',\n",
       "           'location': '113.632960,23.615768'},\n",
       "          {'name': '云星村',\n",
       "           'id': '900000069692039',\n",
       "           'location': '113.630829,23.610747'},\n",
       "          {'name': '宣星路口',\n",
       "           'id': '900000069692030',\n",
       "           'location': '113.628841,23.602378'},\n",
       "          {'name': '新华站',\n",
       "           'id': '900000069692040',\n",
       "           'location': '113.621693,23.591706'},\n",
       "          {'name': '水底村',\n",
       "           'id': '900000069692041',\n",
       "           'location': '113.619384,23.587461'},\n",
       "          {'name': '南洋理工职业学院',\n",
       "           'id': '900000069692016',\n",
       "           'location': '113.617578,23.582387'},\n",
       "          {'name': '江浦社区',\n",
       "           'id': '900000069692042',\n",
       "           'location': '113.618229,23.573194'},\n",
       "          {'name': '江村',\n",
       "           'id': '900000069692043',\n",
       "           'location': '113.618312,23.568967'},\n",
       "          {'name': '水利学院',\n",
       "           'id': '900000069692044',\n",
       "           'location': '113.619188,23.563064'}]},\n",
       "        {'departure_stop': {'name': '三层路口',\n",
       "          'id': '900000069254022',\n",
       "          'location': '113.677689,23.648294'},\n",
       "         'arrival_stop': {'name': '沙塱村',\n",
       "          'id': '900000069254053',\n",
       "          'location': '113.615534,23.557400'},\n",
       "         'name': '从12路(吕田客运站总站--从化汽车站总站)',\n",
       "         'id': '900000069254',\n",
       "         'type': '普通公交线路',\n",
       "         'distance': '13087',\n",
       "         'duration': '1923',\n",
       "         'polyline': '113.677689,23.648294;113.677687,23.648290;113.677378,23.648016;113.676372,23.647088;113.675964,23.646745;113.675734,23.646567;113.675464,23.646385;113.675095,23.646172;113.673003,23.645004;113.671771,23.644327;113.671771,23.644323;113.669961,23.643329;113.669162,23.642882;113.668776,23.642674;113.668598,23.642578;113.667001,23.641693;113.666141,23.641172;113.665317,23.640564;113.665252,23.640512;113.665017,23.640299;113.664774,23.640065;113.664549,23.639813;113.664410,23.639661;113.664201,23.639401;113.663928,23.639019;113.663576,23.638451;113.663359,23.638021;113.662322,23.635933;113.661949,23.635182;113.661454,23.634266;113.661224,23.633898;113.660842,23.633381;113.660686,23.633190;113.660252,23.632704;113.659722,23.632170;113.659366,23.631879;113.659258,23.631793;113.658984,23.631589;113.658893,23.631519;113.658212,23.631102;113.657708,23.630760;113.657426,23.630590;113.656984,23.630330;113.656984,23.630326;113.654336,23.628741;113.653850,23.628416;113.653598,23.628225;113.652674,23.627422;113.652370,23.627261;113.652114,23.627062;113.651510,23.626654;113.651363,23.626554;113.651050,23.626315;113.650573,23.625885;113.650091,23.625378;113.649970,23.625269;113.649822,23.625143;113.649766,23.625013;113.648980,23.624384;113.648611,23.624063;113.647843,23.623442;113.647361,23.623090;113.646780,23.622721;113.646345,23.622465;113.645981,23.622287;113.645595,23.622131;113.645117,23.621992;113.644709,23.621914;113.644661,23.621905;113.644669,23.621906;113.644666,23.621905;113.644375,23.621862;113.643255,23.621749;113.642578,23.621667;113.642474,23.621645;113.642027,23.621541;113.641450,23.621354;113.640525,23.621033;113.639332,23.620603;113.639184,23.620543;113.638850,23.620412;113.638472,23.620234;113.638355,23.620174;113.638355,23.620169;113.636046,23.618945;113.635543,23.618668;113.635252,23.618481;113.634748,23.618099;113.634518,23.617891;113.634262,23.617622;113.633980,23.617270;113.633633,23.616780;113.633056,23.615911;113.632917,23.615699;113.632912,23.615699;113.632400,23.614926;113.631910,23.614171;113.631667,23.613711;113.631432,23.613142;113.631293,23.612661;113.630907,23.611076;113.630842,23.610803;113.630825,23.610729;113.630825,23.610725;113.630764,23.610516;113.630660,23.610061;113.630569,23.609705;113.630547,23.609618;113.630495,23.609388;113.630113,23.607821;113.629774,23.606389;113.629392,23.604740;113.628880,23.602548;113.628880,23.602543;113.628477,23.600820;113.628134,23.599293;113.627969,23.598681;113.627951,23.598633;113.627882,23.598433;113.627782,23.598203;113.627635,23.597921;113.627487,23.597682;113.627279,23.597400;113.627040,23.597140;113.626102,23.596228;113.625647,23.595755;113.624996,23.595139;113.624089,23.594327;113.623164,23.593433;113.622882,23.593147;113.622734,23.592982;113.622378,23.592591;113.622053,23.592188;113.621875,23.591957;113.621684,23.591693;113.621680,23.591693;113.621576,23.591545;113.621289,23.591133;113.621124,23.590864;113.620734,23.590165;113.620603,23.589913;113.619475,23.587643;113.619392,23.587470;113.619388,23.587470;113.619175,23.587040;113.618984,23.586658;113.618893,23.586471;113.618598,23.585868;113.618108,23.584874;113.617930,23.584440;113.617769,23.583928;113.617708,23.583646;113.617630,23.583073;113.617582,23.582478;113.617578,23.582370;113.617552,23.581884;113.617474,23.580651;113.617474,23.580590;113.617474,23.580516;113.617483,23.580204;113.617496,23.579848;113.617556,23.579384;113.617674,23.578741;113.617760,23.578316;113.617791,23.578138;113.618043,23.576905;113.618082,23.576723;113.618095,23.576658;113.618116,23.576558;113.618190,23.576189;113.618346,23.575378;113.618420,23.574809;113.618424,23.574497;113.618407,23.574158;113.618281,23.573481;113.618264,23.573381;113.618212,23.573108;113.618210,23.573120;113.618210,23.573116;113.618134,23.572729;113.618080,23.572432;113.618034,23.572153;113.618011,23.571901;113.617989,23.571444;113.618034,23.570911;113.618149,23.570036;113.618187,23.569813;113.618317,23.568937;113.618316,23.568937;113.618333,23.568824;113.618464,23.567951;113.618485,23.567786;113.618646,23.566697;113.618759,23.565946;113.618793,23.565673;113.618828,23.565473;113.618845,23.565365;113.618872,23.565182;113.618893,23.565013;113.618902,23.564965;113.619123,23.563464;113.619175,23.563155;113.619188,23.563056;113.619262,23.562522;113.619288,23.562109;113.619262,23.561775;113.619232,23.561602;113.619171,23.561385;113.619010,23.561011;113.618793,23.560673;113.618646,23.560495;113.618142,23.559970;113.617943,23.559766;113.616970,23.558819;113.615729,23.557600;113.615534,23.557400',\n",
       "         'bustimetag': '0',\n",
       "         'start_time': '0630',\n",
       "         'end_time': '1900',\n",
       "         'via_num': '13',\n",
       "         'via_stops': [{'name': '卫东',\n",
       "           'id': '900000069254023',\n",
       "           'location': '113.671771,23.644327'},\n",
       "          {'name': '温泉交警中队',\n",
       "           'id': '900000069254024',\n",
       "           'location': '113.656984,23.630330'},\n",
       "          {'name': '牛步径',\n",
       "           'id': '900000069254041',\n",
       "           'location': '113.644661,23.621905'},\n",
       "          {'name': '华辉度假村',\n",
       "           'id': '900000069254047',\n",
       "           'location': '113.638355,23.620174'},\n",
       "          {'name': '温泉镇政府',\n",
       "           'id': '900000069254025',\n",
       "           'location': '113.632917,23.615699'},\n",
       "          {'name': '云星村站',\n",
       "           'id': '900000069254048',\n",
       "           'location': '113.630825,23.610729'},\n",
       "          {'name': '宣星路口',\n",
       "           'id': '900000069254026',\n",
       "           'location': '113.628880,23.602548'},\n",
       "          {'name': '新华站',\n",
       "           'id': '900000069254049',\n",
       "           'location': '113.621684,23.591693'},\n",
       "          {'name': '水底村',\n",
       "           'id': '900000069254027',\n",
       "           'location': '113.619392,23.587470'},\n",
       "          {'name': '南洋理工职业学院',\n",
       "           'id': '900000069254050',\n",
       "           'location': '113.617578,23.582370'},\n",
       "          {'name': '江埔社区',\n",
       "           'id': '900000069254028',\n",
       "           'location': '113.618212,23.573108'},\n",
       "          {'name': '江村',\n",
       "           'id': '900000069254051',\n",
       "           'location': '113.618317,23.568937'},\n",
       "          {'name': '水利学院',\n",
       "           'id': '900000069254052',\n",
       "           'location': '113.619188,23.563056'}]}]},\n",
       "      'entrance': [],\n",
       "      'exit': [],\n",
       "      'railway': {'via_stops': [], 'alters': [], 'spaces': []}},\n",
       "     {'taxi': [],\n",
       "      'walking': {'origin': '113.615555,23.557423',\n",
       "       'destination': '113.615593,23.557280',\n",
       "       'distance': '64',\n",
       "       'duration': '54',\n",
       "       'steps': [{'instruction': '沿环市东路步行21米右转',\n",
       "         'road': '环市东路',\n",
       "         'distance': '21',\n",
       "         'duration': [],\n",
       "         'polyline': '113.615555,23.557423;113.615692,23.557562',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行14米右转',\n",
       "         'road': [],\n",
       "         'distance': '14',\n",
       "         'duration': [],\n",
       "         'polyline': '113.615692,23.557562;113.615791,23.557474',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿环市东路步行29米到达沙塱村',\n",
       "         'road': '环市东路',\n",
       "         'distance': '29',\n",
       "         'duration': [],\n",
       "         'polyline': '113.615791,23.557470;113.615593,23.557280',\n",
       "         'action': [],\n",
       "         'assistant_action': '到达沙塱村'}]},\n",
       "      'bus': {'buslines': [{'departure_stop': {'name': '沙塱村',\n",
       "          'id': '900000111136007',\n",
       "          'location': '113.615593,23.557278'},\n",
       "         'arrival_stop': {'name': '龙岗墟',\n",
       "          'id': '900000111136028',\n",
       "          'location': '113.668082,23.600477'},\n",
       "         'name': '从19路(从化汽车站总站--高坣总站)',\n",
       "         'id': '900000111136',\n",
       "         'type': '普通公交线路',\n",
       "         'distance': '8259',\n",
       "         'duration': '2794',\n",
       "         'polyline': '113.615593,23.557278;113.615590,23.557274;113.617622,23.559266;113.618247,23.559887;113.618555,23.559796;113.618976,23.559753;113.619180,23.559727;113.619423,23.559740;113.619575,23.559753;113.620221,23.559922;113.620603,23.560009;113.621510,23.560221;113.621766,23.560312;113.621936,23.560417;113.622044,23.560521;113.622652,23.561181;113.622995,23.561589;113.623212,23.561766;113.623490,23.561905;113.624427,23.562179;113.624983,23.562361;113.625955,23.562678;113.626250,23.562804;113.626567,23.562999;113.627409,23.563646;113.627565,23.563811;113.627656,23.563945;113.628060,23.564588;113.628260,23.565022;113.628355,23.565169;113.628924,23.565673;113.629058,23.565794;113.629588,23.566454;113.630109,23.566879;113.630451,23.567153;113.630742,23.567383;113.630877,23.567470;113.631085,23.567652;113.631220,23.567830;113.631328,23.568047;113.631367,23.568147;113.631441,23.568333;113.631697,23.568993;113.631793,23.569154;113.631853,23.569219;113.631988,23.569314;113.632374,23.569488;113.632773,23.569631;113.633060,23.569683;113.633247,23.569688;113.633372,23.569679;113.633368,23.569683;113.633485,23.569674;113.633746,23.569614;113.635330,23.569058;113.636593,23.568641;113.636832,23.568581;113.637205,23.568516;113.637426,23.568503;113.637695,23.568524;113.638047,23.568607;113.638390,23.568741;113.638637,23.568867;113.638633,23.568867;113.638898,23.569002;113.640399,23.569818;113.640647,23.569974;113.640859,23.570152;113.640955,23.570256;113.641163,23.570521;113.641428,23.570816;113.641632,23.570998;113.641970,23.571224;113.642322,23.571406;113.642543,23.571497;113.642578,23.571506;113.642930,23.571628;113.643043,23.571649;113.643286,23.571680;113.643503,23.571680;113.643628,23.571680;113.643624,23.571680;113.643967,23.571675;113.644614,23.571671;113.644878,23.571701;113.644970,23.571727;113.645247,23.571862;113.645959,23.572365;113.646198,23.572561;113.646415,23.572773;113.646606,23.572956;113.646788,23.573151;113.647274,23.573637;113.647405,23.573750;113.649232,23.575178;113.649575,23.575447;113.649618,23.575486;113.649618,23.575482;113.649674,23.575530;113.650378,23.576089;113.651076,23.576658;113.651432,23.576936;113.651649,23.577105;113.652001,23.577383;113.652448,23.577700;113.652704,23.577860;113.653177,23.578108;113.653173,23.578108;113.653429,23.578242;113.653676,23.578368;113.654562,23.578845;113.654913,23.579019;113.655091,23.579084;113.656050,23.579310;113.656411,23.579358;113.656589,23.579484;113.656723,23.579640;113.657235,23.580213;113.657292,23.580304;113.657396,23.580612;113.657431,23.580773;113.657483,23.582105;113.657483,23.582231;113.657470,23.582339;113.657431,23.582439;113.657378,23.582539;113.657157,23.582847;113.657066,23.583025;113.656979,23.583255;113.656888,23.583568;113.656871,23.583676;113.656879,23.583780;113.656905,23.583919;113.657062,23.584449;113.657114,23.584566;113.657322,23.584891;113.657478,23.585156;113.657548,23.585365;113.657691,23.586688;113.657743,23.586931;113.657813,23.587135;113.658021,23.587643;113.658099,23.587830;113.658095,23.587830;113.658750,23.589397;113.658819,23.589588;113.659110,23.590226;113.659622,23.591046;113.659826,23.591389;113.659926,23.591589;113.660456,23.592799;113.660543,23.593021;113.660725,23.593594;113.660825,23.593885;113.660903,23.594028;113.660990,23.594167;113.660990,23.594171;113.660990,23.594167;113.661141,23.594410;113.661306,23.594601;113.661554,23.594844;113.662235,23.595430;113.663477,23.596506;113.663737,23.596775;113.664067,23.597135;113.664392,23.597617;113.664549,23.597865;113.664792,23.598234;113.665122,23.598633;113.665252,23.598780;113.665282,23.598819;113.665512,23.599089;113.665777,23.599362;113.665951,23.599501;113.666224,23.599640;113.667322,23.600135;113.667943,23.600412;113.668082,23.600477',\n",
       "         'bustimetag': '4',\n",
       "         'start_time': '0700',\n",
       "         'end_time': '1800',\n",
       "         'via_num': '9',\n",
       "         'via_stops': [{'name': '灌村路口',\n",
       "           'id': '900000111136045',\n",
       "           'location': '113.618976,23.559753'},\n",
       "          {'name': '福上下社1',\n",
       "           'id': '900000111136037',\n",
       "           'location': '113.631367,23.568147'},\n",
       "          {'name': '福上下社2',\n",
       "           'id': '900000111136038',\n",
       "           'location': '113.633372,23.569679'},\n",
       "          {'name': '石海村',\n",
       "           'id': '900000111136039',\n",
       "           'location': '113.638637,23.568867'},\n",
       "          {'name': '石海小学',\n",
       "           'id': '900000111136040',\n",
       "           'location': '113.643628,23.571680'},\n",
       "          {'name': '石海村委',\n",
       "           'id': '900000111136041',\n",
       "           'location': '113.649618,23.575486'},\n",
       "          {'name': '灌村围',\n",
       "           'id': '900000111136042',\n",
       "           'location': '113.653177,23.578108'},\n",
       "          {'name': '中田里',\n",
       "           'id': '900000111136047',\n",
       "           'location': '113.658099,23.587830'},\n",
       "          {'name': '石桥社',\n",
       "           'id': '900000111136043',\n",
       "           'location': '113.660990,23.594167'}]}]},\n",
       "      'entrance': [],\n",
       "      'exit': [],\n",
       "      'railway': {'via_stops': [], 'alters': [], 'spaces': []}},\n",
       "     {'taxi': [],\n",
       "      'walking': {'origin': '113.668083,23.600477',\n",
       "       'destination': '113.667816,23.600794',\n",
       "       'distance': '59',\n",
       "       'duration': '50',\n",
       "       'steps': [{'instruction': '沿桃园东路步行15米右转',\n",
       "         'road': '桃园东路',\n",
       "         'distance': '15',\n",
       "         'duration': [],\n",
       "         'polyline': '113.668083,23.600477;113.667946,23.600416',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿龙泉路步行44米',\n",
       "         'road': '龙泉路',\n",
       "         'distance': '44',\n",
       "         'duration': [],\n",
       "         'polyline': '113.667946,23.600412;113.667816,23.600794',\n",
       "         'action': [],\n",
       "         'assistant_action': []}]},\n",
       "      'bus': {'buslines': []},\n",
       "      'entrance': [],\n",
       "      'exit': [],\n",
       "      'railway': {'via_stops': [], 'alters': [], 'spaces': []}}]},\n",
       "   {'cost': [],\n",
       "    'duration': '4821',\n",
       "    'nightflag': '0',\n",
       "    'walking_distance': '550',\n",
       "    'distance': '17408',\n",
       "    'missed': '1',\n",
       "    'segments': [{'taxi': [],\n",
       "      'walking': {'origin': '113.678581,23.633133',\n",
       "       'destination': '113.676613,23.631285',\n",
       "       'distance': '518',\n",
       "       'duration': '444',\n",
       "       'steps': [{'instruction': '步行53米左转',\n",
       "         'road': [],\n",
       "         'distance': '53',\n",
       "         'duration': [],\n",
       "         'polyline': '113.678581,23.633133;113.678627,23.633081;113.678619,23.633038;113.678452,23.632895;113.678421,23.632877;113.678360,23.632877;113.678307,23.632921',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行113米右转',\n",
       "         'road': [],\n",
       "         'distance': '113',\n",
       "         'duration': [],\n",
       "         'polyline': '113.678307,23.632921;113.677582,23.632309;113.677559,23.632278;113.677551,23.632200',\n",
       "         'action': '右转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '步行161米左转',\n",
       "         'road': [],\n",
       "         'distance': '161',\n",
       "         'duration': [],\n",
       "         'polyline': '113.677544,23.632196;113.677399,23.632179;113.677284,23.632200;113.677177,23.632244;113.677017,23.632357;113.676811,23.632534;113.676582,23.632778;113.676430,23.632904;113.676292,23.632969',\n",
       "         'action': '左转',\n",
       "         'assistant_action': []},\n",
       "        {'instruction': '沿博学路步行191米到达中大南方学院',\n",
       "         'road': '博学路',\n",
       "         'distance': '191',\n",
       "         'duration': [],\n",
       "         'polyline': '113.676285,23.632969;113.676292,23.632227;113.676338,23.631948;113.676430,23.631676;113.676491,23.631540;113.676613,23.631285',\n",
       "         'action': [],\n",
       "         'assistant_action': '到达中大南方学院'}]},\n",
       "      'bus': {'buslines': [{'departure_stop': {'name': '中大南方学院',\n",
       "          'id': '900000111141002',\n",
       "          'location': '113.676613,23.631281'},\n",
       "         'arrival_stop': {'name': '冲口',\n",
       "          'id': '900000111141022',\n",
       "          'location': '113.649731,23.624987'},\n",
       "         'name': '从15路(中大南方学院--从化汽车站总站)',\n",
       "         'id': '900000111141',\n",
       "         'type': '普通公交线路',\n",
       "         'distance': '6394',\n",
       "         'duration': '1955',\n",
       "         'polyline': '113.676613,23.631281;113.676460,23.631588;113.676430,23.631672;113.676338,23.631945;113.676292,23.632223;113.676285,23.632969;113.676285,23.633560;113.676300,23.633738;113.676331,23.633875;113.676399,23.634016;113.676460,23.634111;113.676521,23.634193;113.676781,23.634409;113.676857,23.634357;113.676933,23.634340;113.677032,23.634354;113.677094,23.634396;113.677139,23.634459;113.677147,23.634535;113.677139,23.634600;113.677086,23.634663;113.677032,23.634701;113.676918,23.634718;113.676857,23.634701;113.676788,23.634657;113.675262,23.636129;113.675156,23.636263;113.675026,23.636467;113.674973,23.636566;113.674957,23.636702;113.674957,23.636845;113.674995,23.636995;113.675377,23.637886;113.675430,23.638042;113.675522,23.638659;113.675529,23.638998;113.675514,23.639132;113.675446,23.639311;113.675331,23.639582;113.675102,23.640036;113.675003,23.640186;113.674309,23.641024;113.673347,23.642139;113.672981,23.642536;113.672935,23.642578;113.672173,23.643307;113.671707,23.643766;113.671432,23.644045;113.673103,23.644968;113.674362,23.645651;113.675461,23.646276;113.675964,23.646635;113.676407,23.647018;113.676376,23.647089;113.675964,23.646744;113.675735,23.646566;113.675468,23.646385;113.675095,23.646172;113.673004,23.645004;113.669968,23.643330;113.669167,23.642881;113.668770,23.642673;113.668594,23.642578;113.667007,23.641693;113.666145,23.641171;113.665314,23.640564;113.665253,23.640511;113.665016,23.640301;113.664772,23.640064;113.664551,23.639812;113.664406,23.639662;113.664207,23.639400;113.663925,23.639021;113.663574,23.638451;113.663361,23.638020;113.662323,23.635933;113.661949,23.635181;113.661461,23.634266;113.661224,23.633898;113.660843,23.633383;113.660683,23.633192;113.660248,23.632704;113.659721,23.632172;113.659370,23.631880;113.659256,23.631794;113.658989,23.631588;113.658897,23.631519;113.658211,23.631102;113.657707,23.630760;113.657425,23.630590;113.656944,23.630304;113.656940,23.630304;113.654336,23.628741;113.653850,23.628416;113.653598,23.628225;113.652383,23.627179;113.650165,23.625326;113.650022,23.625221;113.649766,23.625013;113.649731,23.624987',\n",
       "         'bustimetag': '0',\n",
       "         'start_time': '0900',\n",
       "         'end_time': '1800',\n",
       "         'via_num': '2',\n",
       "         'via_stops': [{'name': '卫东',\n",
       "           'id': '900000111141003',\n",
       "           'location': '113.671707,23.643766'},\n",
       "          {'name': '交警温泉中队',\n",
       "           'id': '900000111141029',\n",
       "           'location': '113.656944,23.630304'}]}]},\n",
       "      'entrance': [],\n",
       "      'exit': [],\n",
       "      'railway': {'via_stops': [], 'alters': [], 'spaces': []}},\n",
       "     {'taxi': [],\n",
       "      'walking': [],\n",
       "      'bus': {'buslines': [{'departure_stop': {'name': '冲口',\n",
       "          'id': '900000111218004',\n",
       "          'location': '113.649731,23.624983'},\n",
       "         'arrival_stop': {'name': '龙岗墟',\n",
       "          'id': '900000111218023',\n",
       "          'location': '113.667899,23.600530'},\n",
       "         'name': '从701路(温泉宾馆--南平村委)',\n",
       "         'id': '900000111218',\n",
       "         'type': '微循环公交',\n",
       "         'distance': '10464',\n",
       "         'duration': '2395',\n",
       "         'polyline': '113.649731,23.624983;113.649727,23.624983;113.648980,23.624384;113.648611,23.624063;113.647843,23.623442;113.647361,23.623090;113.646780,23.622721;113.646345,23.622465;113.645981,23.622287;113.645595,23.622131;113.645117,23.621992;113.644709,23.621914;113.644648,23.621901;113.644644,23.621901;113.644375,23.621862;113.643255,23.621749;113.642578,23.621667;113.642474,23.621645;113.642027,23.621541;113.641450,23.621354;113.640525,23.621033;113.639332,23.620603;113.639184,23.620543;113.638850,23.620412;113.638433,23.620213;113.638325,23.620156;113.638329,23.620155;113.638329,23.620159;113.638329,23.620155;113.636047,23.618944;113.635544,23.618668;113.635254,23.618481;113.634750,23.618097;113.634514,23.617891;113.634254,23.617622;113.633980,23.617271;113.633636,23.616779;113.633057,23.615911;113.632965,23.615782;113.632957,23.615778;113.632401,23.614927;113.631912,23.614172;113.631660,23.613710;113.631432,23.613142;113.631287,23.612659;113.630905,23.611076;113.630844,23.610802;113.630844,23.610798;113.630768,23.610516;113.630661,23.610060;113.630569,23.609705;113.630554,23.609617;113.630501,23.609388;113.630119,23.607822;113.629776,23.606388;113.629395,23.604740;113.628891,23.602587;113.628479,23.600821;113.628136,23.599293;113.627968,23.598680;113.627953,23.598633;113.627884,23.598433;113.627785,23.598202;113.627632,23.597919;113.627487,23.597683;113.627281,23.597401;113.627037,23.597139;113.626106,23.596230;113.625641,23.595755;113.624992,23.595139;113.624092,23.594326;113.623161,23.593433;113.622879,23.593147;113.622978,23.593065;113.623573,23.593662;113.627022,23.596935;113.627274,23.597191;113.627449,23.597414;113.627663,23.597729;113.627869,23.598082;113.627975,23.598307;113.628059,23.598547;113.628090,23.598633;113.628212,23.599079;113.628616,23.600807;113.628723,23.601263;113.628720,23.601263;113.628811,23.601658;113.629280,23.601780;113.630113,23.601445;113.630365,23.601354;113.632248,23.600681;113.633785,23.600347;113.635725,23.599957;113.636810,23.599731;113.637335,23.599657;113.638103,23.599596;113.638542,23.599579;113.639266,23.599588;113.639427,23.599592;113.642270,23.599570;113.642578,23.599570;113.643043,23.599622;113.643581,23.599688;113.643624,23.599661;113.643911,23.599657;113.644232,23.599605;113.644449,23.599614;113.645451,23.599935;113.646454,23.600278;113.646589,23.600347;113.646658,23.600417;113.646931,23.600595;113.649835,23.601749;113.649935,23.601797;113.650030,23.601862;113.650937,23.602674;113.651063,23.602752;113.651176,23.602786;113.651367,23.602826;113.651584,23.602847;113.651845,23.602847;113.652001,23.602830;113.652504,23.602708;113.652839,23.602582;113.652999,23.602548;113.653181,23.602543;113.653264,23.602561;113.653659,23.602752;113.653802,23.602799;113.654605,23.602977;113.655122,23.603069;113.655243,23.603077;113.655391,23.603069;113.655799,23.602999;113.656055,23.602934;113.656302,23.602847;113.657083,23.602530;113.657300,23.602461;113.657500,23.602418;113.659041,23.602205;113.659501,23.602144;113.660009,23.602170;113.660386,23.602144;113.661046,23.601988;113.661845,23.601801;113.662044,23.601740;113.662687,23.601458;113.662951,23.601385;113.663980,23.601424;113.664275,23.601445;113.664549,23.601489;113.664596,23.601497;113.664714,23.601497;113.665464,23.601280;113.665655,23.601233;113.665864,23.601202;113.666658,23.601441;113.666662,23.601441;113.666658,23.601441;113.666758,23.601467;113.667001,23.601545;113.667222,23.601615;113.667465,23.601688;113.667773,23.600877;113.667899,23.600530',\n",
       "         'bustimetag': '2',\n",
       "         'start_time': [],\n",
       "         'end_time': [],\n",
       "         'via_num': '7',\n",
       "         'via_stops': [{'name': '牛步迳',\n",
       "           'id': '900000111218005',\n",
       "           'location': '113.644648,23.621901'},\n",
       "          {'name': '华辉度假村',\n",
       "           'id': '900000111218006',\n",
       "           'location': '113.638325,23.620156'},\n",
       "          {'name': '温泉镇政府',\n",
       "           'id': '900000111218007',\n",
       "           'location': '113.632965,23.615782'},\n",
       "          {'name': '云星村',\n",
       "           'id': '900000111218008',\n",
       "           'location': '113.630844,23.610802'},\n",
       "          {'name': '宣星路口',\n",
       "           'id': '900000111218009',\n",
       "           'location': '113.628891,23.602587'},\n",
       "          {'name': '宣星路口(星光五金水电商场)',\n",
       "           'id': '900000111218021',\n",
       "           'location': '113.628723,23.601263'},\n",
       "          {'name': '教师村',\n",
       "           'id': '900000111218022',\n",
       "           'location': '113.666658,23.601441'}]}]},\n",
       "      'entrance': [],\n",
       "      'exit': [],\n",
       "      'railway': {'via_stops': [], 'alters': [], 'spaces': []}},\n",
       "     {'taxi': [],\n",
       "      'walking': {'origin': '113.667900,23.600529',\n",
       "       'destination': '113.667816,23.600794',\n",
       "       'distance': '31',\n",
       "       'duration': '26',\n",
       "       'steps': [{'instruction': '沿龙泉路步行31米',\n",
       "         'road': '龙泉路',\n",
       "         'distance': '31',\n",
       "         'duration': [],\n",
       "         'polyline': '113.667900,23.600529;113.667816,23.600794',\n",
       "         'action': [],\n",
       "         'assistant_action': []}]},\n",
       "      'bus': {'buslines': []},\n",
       "      'entrance': [],\n",
       "      'exit': [],\n",
       "      'railway': {'via_stops': [], 'alters': [], 'spaces': []}}]}]}}"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "origin='113.678600,23.633329'\n",
    "location='113.668051,23.600869'\n",
    "city='广州'\n",
    "strategy='1'\n",
    "transit(origin,location,city,cityid=None,extensions='base',strategy=strategy,nightflag=0,\n",
    "            date=None,time=None,sig=None,output='json',callback=None)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>cost</th>\n",
       "      <th>duration</th>\n",
       "      <th>nightflag</th>\n",
       "      <th>walking_distance</th>\n",
       "      <th>distance</th>\n",
       "      <th>missed</th>\n",
       "      <th>segments</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>4.0</td>\n",
       "      <td>5192</td>\n",
       "      <td>0</td>\n",
       "      <td>961</td>\n",
       "      <td>14868</td>\n",
       "      <td>0</td>\n",
       "      <td>[{'taxi': [], 'walking': {'origin': '113.67858...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4.0</td>\n",
       "      <td>6190</td>\n",
       "      <td>0</td>\n",
       "      <td>642</td>\n",
       "      <td>24135</td>\n",
       "      <td>0</td>\n",
       "      <td>[{'taxi': [], 'walking': {'origin': '113.67858...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4.0</td>\n",
       "      <td>5987</td>\n",
       "      <td>0</td>\n",
       "      <td>2957</td>\n",
       "      <td>14702</td>\n",
       "      <td>0</td>\n",
       "      <td>[{'taxi': [], 'walking': {'origin': '113.67849...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.0</td>\n",
       "      <td>6970</td>\n",
       "      <td>0</td>\n",
       "      <td>2634</td>\n",
       "      <td>23756</td>\n",
       "      <td>0</td>\n",
       "      <td>[{'taxi': [], 'walking': {'origin': '113.67849...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>[]</td>\n",
       "      <td>4821</td>\n",
       "      <td>0</td>\n",
       "      <td>550</td>\n",
       "      <td>17408</td>\n",
       "      <td>1</td>\n",
       "      <td>[{'taxi': [], 'walking': {'origin': '113.67858...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  cost duration nightflag walking_distance distance missed  \\\n",
       "0  4.0     5192         0              961    14868      0   \n",
       "1  4.0     6190         0              642    24135      0   \n",
       "2  4.0     5987         0             2957    14702      0   \n",
       "3  4.0     6970         0             2634    23756      0   \n",
       "4   []     4821         0              550    17408      1   \n",
       "\n",
       "                                            segments  \n",
       "0  [{'taxi': [], 'walking': {'origin': '113.67858...  \n",
       "1  [{'taxi': [], 'walking': {'origin': '113.67858...  \n",
       "2  [{'taxi': [], 'walking': {'origin': '113.67849...  \n",
       "3  [{'taxi': [], 'walking': {'origin': '113.67849...  \n",
       "4  [{'taxi': [], 'walking': {'origin': '113.67858...  "
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a=transit(origin,location,city,cityid=None,extensions='base',strategy=0,nightflag=0,\n",
    "            date=None,time=None,sig=None,output='json',callback=None)['route']['transits']\n",
    "import pandas as pd\n",
    "pd.json_normalize(a)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "3.3驾车路径规划"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [],
   "source": [
    "def driving(key,origin,destination,extensions):\n",
    "    #驾车路径规划\n",
    "    url='https://restapi.amap.com/v3/direction/driving?parameters'\n",
    "    params={\n",
    "        'key':key,\n",
    "        'origin':origin,\n",
    "        'destination':destination,\n",
    "        'extensions':extensions   \n",
    "    }\n",
    "    response=requests.get(url,params)\n",
    "    results=response.json()\n",
    "    return results"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000',\n",
       " 'count': '1',\n",
       " 'route': {'origin': '113.678600,23.633329',\n",
       "  'destination': '113.668051,23.600869',\n",
       "  'paths': [{'distance': '5846',\n",
       "    'duration': '911',\n",
       "    'strategy': '速度最快',\n",
       "    'tolls': '0',\n",
       "    'toll_distance': '0',\n",
       "    'steps': [{'instruction': '向东北行驶116米右转',\n",
       "      'orientation': '东北',\n",
       "      'distance': '116',\n",
       "      'tolls': '0',\n",
       "      'toll_distance': '0',\n",
       "      'toll_road': [],\n",
       "      'duration': '49',\n",
       "      'polyline': '113.67872,23.633251;113.679462,23.633911;113.679549,23.633967',\n",
       "      'action': '右转',\n",
       "      'assistant_action': []},\n",
       "     {'instruction': '向南行驶32米向右前方行驶',\n",
       "      'orientation': '南',\n",
       "      'distance': '32',\n",
       "      'tolls': '0',\n",
       "      'toll_distance': '0',\n",
       "      'toll_road': [],\n",
       "      'duration': '14',\n",
       "      'polyline': '113.679549,23.633967;113.679648,23.633689',\n",
       "      'action': '向右前方行驶',\n",
       "      'assistant_action': []},\n",
       "     {'instruction': '向南行驶131米左转',\n",
       "      'orientation': '南',\n",
       "      'distance': '131',\n",
       "      'tolls': '0',\n",
       "      'toll_distance': '0',\n",
       "      'toll_road': [],\n",
       "      'duration': '38',\n",
       "      'polyline': '113.679648,23.633689;113.679627,23.63365;113.679596,23.633251;113.679592,23.633173;113.679596,23.632856;113.679596,23.632491',\n",
       "      'action': '左转',\n",
       "      'assistant_action': []},\n",
       "     {'instruction': '向东行驶100米右转',\n",
       "      'orientation': '东',\n",
       "      'distance': '100',\n",
       "      'tolls': '0',\n",
       "      'toll_distance': '0',\n",
       "      'toll_road': [],\n",
       "      'duration': '29',\n",
       "      'polyline': '113.679596,23.632491;113.680582,23.632522',\n",
       "      'action': '右转',\n",
       "      'assistant_action': []},\n",
       "     {'instruction': '向南行驶199米向右前方行驶',\n",
       "      'orientation': '南',\n",
       "      'distance': '199',\n",
       "      'tolls': '0',\n",
       "      'toll_distance': '0',\n",
       "      'toll_road': [],\n",
       "      'duration': '48',\n",
       "      'polyline': '113.680582,23.632522;113.680642,23.632135;113.680668,23.631736;113.680642,23.631589;113.680629,23.631536;113.68059,23.631432;113.680499,23.631237;113.680399,23.631089;113.680204,23.630838',\n",
       "      'action': '向右前方行驶',\n",
       "      'assistant_action': []},\n",
       "     {'instruction': '向西行驶159米左转',\n",
       "      'orientation': '西',\n",
       "      'distance': '159',\n",
       "      'tolls': '0',\n",
       "      'toll_distance': '0',\n",
       "      'toll_road': [],\n",
       "      'duration': '35',\n",
       "      'polyline': '113.680204,23.630838;113.68003,23.630768;113.67964,23.630634;113.679358,23.630516;113.679197,23.630469;113.678711,23.63036',\n",
       "      'action': '左转',\n",
       "      'assistant_action': []},\n",
       "     {'instruction': '向南行驶237米左转',\n",
       "      'orientation': '南',\n",
       "      'distance': '237',\n",
       "      'tolls': '0',\n",
       "      'toll_distance': '0',\n",
       "      'toll_road': [],\n",
       "      'duration': '66',\n",
       "      'polyline': '113.678711,23.63036;113.678711,23.629336;113.678698,23.629128;113.678663,23.629054;113.678572,23.628984;113.67842,23.628898;113.678364,23.628837;113.678325,23.628772;113.678299,23.628646;113.678273,23.628372',\n",
       "      'action': '左转',\n",
       "      'assistant_action': []},\n",
       "     {'instruction': '向东南行驶105米向右前方行驶',\n",
       "      'orientation': '东南',\n",
       "      'distance': '105',\n",
       "      'tolls': '0',\n",
       "      'toll_distance': '0',\n",
       "      'toll_road': [],\n",
       "      'duration': '46',\n",
       "      'polyline': '113.678273,23.628372;113.678572,23.628333;113.678689,23.628303;113.678845,23.628234;113.679045,23.628069;113.679162,23.62796',\n",
       "      'action': '向右前方行驶',\n",
       "      'assistant_action': []},\n",
       "     {'instruction': '向南行驶393米向右前方行驶',\n",
       "      'orientation': '南',\n",
       "      'distance': '393',\n",
       "      'tolls': '0',\n",
       "      'toll_distance': '0',\n",
       "      'toll_road': [],\n",
       "      'duration': '58',\n",
       "      'polyline': '113.679162,23.62796;113.679214,23.627865;113.679236,23.627773;113.67928,23.627522;113.679288,23.627318;113.679249,23.626849;113.679184,23.626619;113.679136,23.626493;113.679002,23.62625;113.678937,23.626172;113.678707,23.625972;113.678615,23.625859;113.678529,23.625716;113.678507,23.625634;113.678433,23.625187;113.678424,23.625052;113.678455,23.624931;113.678572,23.624653',\n",
       "      'action': '向右前方行驶',\n",
       "      'assistant_action': []},\n",
       "     {'instruction': '沿源富街途径源湖街向西南行驶2.4千米左转',\n",
       "      'orientation': '西南',\n",
       "      'road': '源富街',\n",
       "      'distance': '2351',\n",
       "      'tolls': '0',\n",
       "      'toll_distance': '0',\n",
       "      'toll_road': [],\n",
       "      'duration': '254',\n",
       "      'polyline': '113.678572,23.624653;113.678555,23.624505;113.678411,23.624323;113.677578,23.623789;113.676528,23.623346;113.676354,23.623247;113.676263,23.623147;113.676102,23.62283;113.676037,23.622734;113.675786,23.622474;113.675499,23.62227;113.675412,23.62217;113.675378,23.622083;113.675373,23.621832;113.675391,23.621606;113.675438,23.621471;113.675538,23.621354;113.675764,23.621176;113.675851,23.621085;113.675898,23.62099;113.675911,23.620851;113.675868,23.62072;113.675786,23.620603;113.675742,23.620543;113.675595,23.620369;113.675239,23.620009;113.674931,23.619714;113.673919,23.61862;113.673689,23.618429;113.673459,23.618333;113.673216,23.618268;113.671081,23.617786;113.667895,23.617096;113.666341,23.616736;113.665916,23.616649;113.664549,23.616345;113.663585,23.616128;113.663507,23.616107;113.663225,23.616042;113.662569,23.615911;113.662027,23.615803;113.661684,23.615712;113.660404,23.615417',\n",
       "      'action': '左转',\n",
       "      'assistant_action': []},\n",
       "     {'instruction': '沿龙泉路向东南行驶1.9千米左转',\n",
       "      'orientation': '东南',\n",
       "      'road': '龙泉路',\n",
       "      'distance': '1858',\n",
       "      'tolls': '0',\n",
       "      'toll_distance': '0',\n",
       "      'toll_road': [],\n",
       "      'duration': '209',\n",
       "      'polyline': '113.660404,23.615417;113.660872,23.61513;113.661315,23.614831;113.661619,23.614596;113.661667,23.614527;113.661736,23.614349;113.661797,23.614145;113.661862,23.614006;113.661914,23.613937;113.662079,23.613789;113.662613,23.613381;113.662756,23.61322;113.662804,23.613142;113.66434,23.609618;113.664549,23.609128;113.665095,23.607891;113.665694,23.606523;113.667018,23.602865;113.667179,23.602465;113.667361,23.601984;113.667465,23.601688;113.667565,23.601437;113.667665,23.601159;113.667773,23.600877;113.667943,23.600412',\n",
       "      'action': '左转',\n",
       "      'assistant_action': []},\n",
       "     {'instruction': '沿桃园东路向东北行驶82米左转',\n",
       "      'orientation': '东北',\n",
       "      'road': '桃园东路',\n",
       "      'distance': '82',\n",
       "      'tolls': '0',\n",
       "      'toll_distance': '0',\n",
       "      'toll_road': [],\n",
       "      'duration': '22',\n",
       "      'polyline': '113.667943,23.600412;113.668437,23.600642;113.668663,23.600764',\n",
       "      'action': '左转',\n",
       "      'assistant_action': []},\n",
       "     {'instruction': '沿龙岗福安街向西北行驶48米左转',\n",
       "      'orientation': '西北',\n",
       "      'road': '龙岗福安街',\n",
       "      'distance': '48',\n",
       "      'tolls': '0',\n",
       "      'toll_distance': '0',\n",
       "      'toll_road': [],\n",
       "      'duration': '31',\n",
       "      'polyline': '113.668663,23.600764;113.668451,23.601003;113.668398,23.60112',\n",
       "      'action': '左转',\n",
       "      'assistant_action': []},\n",
       "     {'instruction': '向西行驶35米到达目的地',\n",
       "      'orientation': '西',\n",
       "      'distance': '35',\n",
       "      'tolls': '0',\n",
       "      'toll_distance': '0',\n",
       "      'toll_road': [],\n",
       "      'duration': '12',\n",
       "      'polyline': '113.668398,23.60112;113.668325,23.601094;113.668095,23.601011;113.668077,23.601016',\n",
       "      'action': [],\n",
       "      'assistant_action': '到达目的地'}],\n",
       "    'restriction': '0',\n",
       "    'traffic_lights': '0'}]}}"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "origin='113.678600,23.633329'\n",
    "location='113.668051,23.600869'\n",
    "extensions='base'\n",
    "driving(key,origin,location,extensions)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0               向东北行驶116米右转\n",
       "1             向南行驶32米向右前方行驶\n",
       "2                向南行驶131米左转\n",
       "3                向东行驶100米右转\n",
       "4            向南行驶199米向右前方行驶\n",
       "5                向西行驶159米左转\n",
       "6                向南行驶237米左转\n",
       "7           向东南行驶105米向右前方行驶\n",
       "8            向南行驶393米向右前方行驶\n",
       "9     沿源富街途径源湖街向西南行驶2.4千米左转\n",
       "10         沿龙泉路向东南行驶1.9千米左转\n",
       "11          沿桃园东路向东北行驶82米左转\n",
       "12         沿龙岗福安街向西北行驶48米左转\n",
       "13             向西行驶35米到达目的地\n",
       "Name: instruction, dtype: object"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a=driving(key,origin,location,extensions)['route']['paths'][0]['steps']\n",
    "pd.json_normalize(a)['instruction']"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "3.4骑行路径规划"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [],
   "source": [
    "def bicycling(key,origin,destination):\n",
    "    #骑车路径规划\n",
    "    url='https://restapi.amap.com/v4/direction/bicycling?parameters'\n",
    "    params={\n",
    "        'key':key,\n",
    "        'origin':origin,\n",
    "        'destination':destination\n",
    "    }\n",
    "    response=requests.get(url,params)\n",
    "    results=response.json()\n",
    "    return results"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'data': {'destination': '113.668051,23.600869',\n",
       "  'origin': '113.678600,23.633329',\n",
       "  'paths': [{'distance': 5234,\n",
       "    'duration': 1256,\n",
       "    'steps': [{'action': '右转',\n",
       "      'assistant_action': '',\n",
       "      'distance': 115,\n",
       "      'duration': 28,\n",
       "      'instruction': '向东北骑行115米右转',\n",
       "      'orientation': '东北',\n",
       "      'polyline': '113.678724,23.633251;113.679466,23.633915;113.679549,23.633967',\n",
       "      'road': '',\n",
       "      'walk_type': 0},\n",
       "     {'action': '向右前方行驶',\n",
       "      'assistant_action': '',\n",
       "      'distance': 32,\n",
       "      'duration': 8,\n",
       "      'instruction': '向南骑行32米向右前方行驶',\n",
       "      'orientation': '南',\n",
       "      'polyline': '113.679549,23.633967;113.679648,23.633694',\n",
       "      'road': '',\n",
       "      'walk_type': 0},\n",
       "     {'action': '左转',\n",
       "      'assistant_action': '',\n",
       "      'distance': 131,\n",
       "      'duration': 31,\n",
       "      'instruction': '向南骑行131米左转',\n",
       "      'orientation': '南',\n",
       "      'polyline': '113.679648,23.633689;113.679627,23.633655;113.679596,23.633255;113.679596,23.633255;113.679596,23.633177;113.679596,23.633177;113.679596,23.63286;113.679596,23.63286;113.679596,23.632496',\n",
       "      'road': '',\n",
       "      'walk_type': 0},\n",
       "     {'action': '右转',\n",
       "      'assistant_action': '',\n",
       "      'distance': 100,\n",
       "      'duration': 24,\n",
       "      'instruction': '向东骑行100米右转',\n",
       "      'orientation': '东',\n",
       "      'polyline': '113.679592,23.632491;113.680586,23.632522',\n",
       "      'road': '',\n",
       "      'walk_type': 0},\n",
       "     {'action': '向右前方行驶',\n",
       "      'assistant_action': '',\n",
       "      'distance': 199,\n",
       "      'duration': 48,\n",
       "      'instruction': '向南骑行199米向右前方行驶',\n",
       "      'orientation': '南',\n",
       "      'polyline': '113.680586,23.632522;113.680638,23.63214;113.680668,23.63174;113.680634,23.631541;113.68059,23.631437;113.68059,23.631437;113.680499,23.631241;113.680408,23.631094;113.680208,23.630842',\n",
       "      'road': '',\n",
       "      'walk_type': 0},\n",
       "     {'action': '左转',\n",
       "      'assistant_action': '',\n",
       "      'distance': 159,\n",
       "      'duration': 38,\n",
       "      'instruction': '向西骑行159米左转',\n",
       "      'orientation': '西',\n",
       "      'polyline': '113.680204,23.630838;113.680035,23.630773;113.680035,23.630773;113.679644,23.630638;113.679644,23.630638;113.679362,23.630521;113.679201,23.630473;113.679201,23.630473;113.679032,23.63043;113.679032,23.63043;113.67888,23.630404;113.67888,23.630404;113.678711,23.630365',\n",
       "      'road': '',\n",
       "      'walk_type': 0},\n",
       "     {'action': '左转',\n",
       "      'assistant_action': '',\n",
       "      'distance': 237,\n",
       "      'duration': 57,\n",
       "      'instruction': '向南骑行237米左转',\n",
       "      'orientation': '南',\n",
       "      'polyline': '113.678711,23.63036;113.678711,23.62934;113.678711,23.62934;113.678711,23.629193;113.678689,23.629084;113.678637,23.629023;113.678424,23.628902;113.678368,23.628841;113.678316,23.628724;113.678294,23.628611;113.678294,23.628611;113.678277,23.628372',\n",
       "      'road': '',\n",
       "      'walk_type': 0},\n",
       "     {'action': '向右前方行驶',\n",
       "      'assistant_action': '',\n",
       "      'distance': 498,\n",
       "      'duration': 120,\n",
       "      'instruction': '向南骑行498米向右前方行驶',\n",
       "      'orientation': '南',\n",
       "      'polyline': '113.678273,23.628368;113.678572,23.628338;113.678685,23.628307;113.678685,23.628307;113.678845,23.628234;113.679045,23.628073;113.679158,23.627964;113.679158,23.627964;113.679214,23.627869;113.679236,23.627778;113.67928,23.627526;113.679288,23.627322;113.679288,23.627322;113.679253,23.626853;113.679184,23.626623;113.679141,23.626497;113.679002,23.626259;113.678941,23.626176;113.678711,23.625977;113.67862,23.625864;113.678529,23.62572;113.678438,23.625191;113.678429,23.625056;113.678451,23.624939;113.678572,23.624657',\n",
       "      'road': '',\n",
       "      'walk_type': 0},\n",
       "     {'action': '左转',\n",
       "      'assistant_action': '',\n",
       "      'distance': 722,\n",
       "      'duration': 173,\n",
       "      'instruction': '向西南骑行722米左转',\n",
       "      'orientation': '西南',\n",
       "      'polyline': '113.678572,23.624653;113.678559,23.62451;113.678416,23.624323;113.678416,23.624323;113.677582,23.623793;113.676532,23.623346;113.676363,23.623255;113.676272,23.623151;113.676111,23.622834;113.676042,23.622739;113.67579,23.622483;113.675499,23.622279;113.675417,23.622174;113.675386,23.622088;113.675378,23.621836;113.675378,23.621836;113.675391,23.62161;113.675434,23.621476;113.675543,23.621359;113.675764,23.621181;113.675846,23.621089;113.675903,23.620994;113.675907,23.620855;113.675877,23.620725;113.675747,23.620547;113.675599,23.620373;113.675243,23.620013',\n",
       "      'road': '',\n",
       "      'walk_type': 0},\n",
       "     {'action': '向右前方行驶',\n",
       "      'assistant_action': '',\n",
       "      'distance': 412,\n",
       "      'duration': 99,\n",
       "      'instruction': '向东南骑行412米向右前方行驶',\n",
       "      'orientation': '东南',\n",
       "      'polyline': '113.675239,23.620009;113.67549,23.620013;113.675642,23.619991;113.675773,23.619948;113.676016,23.619796;113.676901,23.619193;113.677261,23.618785;113.678069,23.61783;113.678069,23.61783;113.678181,23.617656',\n",
       "      'road': '',\n",
       "      'walk_type': 0},\n",
       "     {'action': '右转',\n",
       "      'assistant_action': '',\n",
       "      'distance': 1381,\n",
       "      'duration': 331,\n",
       "      'instruction': '沿乌土街向南骑行1381米右转',\n",
       "      'orientation': '南',\n",
       "      'polyline': '113.678181,23.617652;113.678095,23.617205;113.678051,23.617075;113.677973,23.616923;113.677743,23.616558;113.677609,23.616289;113.677391,23.615816;113.677339,23.615668;113.67714,23.614826;113.677049,23.614323;113.676927,23.613359;113.676845,23.612786;113.676602,23.611489;113.676415,23.610438;113.676411,23.610265;113.676411,23.610265;113.676489,23.609848;113.676502,23.609622;113.676493,23.609236;113.676415,23.608746;113.676415,23.608485;113.67648,23.60819;113.67661,23.607734;113.676819,23.606736;113.676862,23.606541;113.676914,23.606415;113.677014,23.606254;113.677535,23.605673',\n",
       "      'road': '乌土街',\n",
       "      'walk_type': 0},\n",
       "     {'action': '直行',\n",
       "      'assistant_action': '',\n",
       "      'distance': 165,\n",
       "      'duration': 40,\n",
       "      'instruction': '沿乌土街向西南骑行165米直行',\n",
       "      'orientation': '西南',\n",
       "      'polyline': '113.677535,23.605668;113.676988,23.605373;113.676402,23.605;113.676163,23.604887',\n",
       "      'road': '乌土街',\n",
       "      'walk_type': 0},\n",
       "     {'action': '直行',\n",
       "      'assistant_action': '',\n",
       "      'distance': 118,\n",
       "      'duration': 28,\n",
       "      'instruction': '沿934县道向西骑行118米直行',\n",
       "      'orientation': '西',\n",
       "      'polyline': '113.676159,23.604883;113.675799,23.604805;113.675508,23.604779;113.675508,23.604779;113.675013,23.60474',\n",
       "      'road': '934县道',\n",
       "      'walk_type': 0},\n",
       "     {'action': '向右前方行驶',\n",
       "      'assistant_action': '',\n",
       "      'distance': 674,\n",
       "      'duration': 162,\n",
       "      'instruction': '沿桃园东路向西南骑行674米向右前方行驶',\n",
       "      'orientation': '西南',\n",
       "      'polyline': '113.675009,23.604735;113.674236,23.604683;113.673893,23.604618;113.673464,23.604492;113.673464,23.604492;113.67168,23.604006;113.671541,23.603958;113.671411,23.603854;113.671068,23.603472;113.670807,23.603264;113.670807,23.603264;113.670525,23.603073;113.6702,23.602904;113.6702,23.602904;113.670022,23.602795;113.670022,23.602795;113.669909,23.602682;113.669818,23.602517;113.669787,23.602413;113.669718,23.601901',\n",
       "      'road': '桃园东路',\n",
       "      'walk_type': 0},\n",
       "     {'action': '右转',\n",
       "      'assistant_action': '',\n",
       "      'distance': 247,\n",
       "      'duration': 59,\n",
       "      'instruction': '沿桃园东路向西南骑行247米右转',\n",
       "      'orientation': '西南',\n",
       "      'polyline': '113.669714,23.601897;113.66964,23.601771;113.66964,23.601771;113.669488,23.601558;113.669488,23.601558;113.668789,23.600859;113.668663,23.600768;113.668663,23.600768;113.668442,23.600647;113.667947,23.600417',\n",
       "      'road': '桃园东路',\n",
       "      'walk_type': 0},\n",
       "     {'action': '',\n",
       "      'assistant_action': '到达目的地',\n",
       "      'distance': 44,\n",
       "      'duration': 11,\n",
       "      'instruction': '沿龙泉路向北骑行44米到达目的地',\n",
       "      'orientation': '北',\n",
       "      'polyline': '113.667943,23.600412;113.667812,23.600794',\n",
       "      'road': '龙泉路',\n",
       "      'walk_type': 0}]}]},\n",
       " 'errcode': 0,\n",
       " 'errdetail': None,\n",
       " 'errmsg': 'OK',\n",
       " 'ext': None}"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "origin='113.678600,23.633329'\n",
    "location='113.668051,23.600869'\n",
    "bicycling(key,origin,location)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0              向东北骑行115米右转\n",
       "1            向南骑行32米向右前方行驶\n",
       "2               向南骑行131米左转\n",
       "3               向东骑行100米右转\n",
       "4           向南骑行199米向右前方行驶\n",
       "5               向西骑行159米左转\n",
       "6               向南骑行237米左转\n",
       "7           向南骑行498米向右前方行驶\n",
       "8              向西南骑行722米左转\n",
       "9          向东南骑行412米向右前方行驶\n",
       "10         沿乌土街向南骑行1381米右转\n",
       "11         沿乌土街向西南骑行165米直行\n",
       "12        沿934县道向西骑行118米直行\n",
       "13    沿桃园东路向西南骑行674米向右前方行驶\n",
       "14        沿桃园东路向西南骑行247米右转\n",
       "15        沿龙泉路向北骑行44米到达目的地\n",
       "Name: instruction, dtype: object"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a=bicycling(key,origin,location)['data']['paths'][0]['steps']\n",
    "pd.json_normalize(a)['instruction']"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "3.5货车路径规划"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [],
   "source": [
    "def truck(key,origin,location,size):\n",
    "    #货车路径规划\n",
    "    url='https://restapi.amap.com/v4/direction/truck?parameters'\n",
    "    params={\n",
    "        'key':key,\n",
    "        'origin':origin,\n",
    "        'destination':location, \n",
    "        'size':size\n",
    "    }\n",
    "    response=requests.get(url,params)\n",
    "    results=response.json()\n",
    "    return results"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'data': {'route': {'destination': '113.668051,23.600869',\n",
       "   'origin': '113.678600,23.633329',\n",
       "   'paths': [{'distance': 5192,\n",
       "     'duration': 921,\n",
       "     'restriction': 0,\n",
       "     'steps': [{'action': '右转',\n",
       "       'assistant_action': '',\n",
       "       'cities': [{'adcode': '440117',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None}],\n",
       "       'distance': 116,\n",
       "       'duration': 49,\n",
       "       'instruction': '向东北行驶116米右转',\n",
       "       'orientation': '东北',\n",
       "       'polyline': '113.67872,23.633251;113.679462,23.633911;113.679549,23.633967',\n",
       "       'road': None,\n",
       "       'tmcs': [{'distance': 116,\n",
       "         'polyline': '113.67872,23.633251;113.679462,23.633911;113.679549,23.633967',\n",
       "         'status': '未知'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0},\n",
       "      {'action': '向右前方行驶',\n",
       "       'assistant_action': '',\n",
       "       'cities': [{'adcode': '440117',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None}],\n",
       "       'distance': 32,\n",
       "       'duration': 14,\n",
       "       'instruction': '向南行驶32米向右前方行驶',\n",
       "       'orientation': '南',\n",
       "       'polyline': '113.679549,23.633967;113.679648,23.633689',\n",
       "       'road': None,\n",
       "       'tmcs': [{'distance': 32,\n",
       "         'polyline': '113.679549,23.633967;113.679648,23.633689',\n",
       "         'status': '未知'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0},\n",
       "      {'action': '左转',\n",
       "       'assistant_action': '',\n",
       "       'cities': [{'adcode': '440117',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None}],\n",
       "       'distance': 131,\n",
       "       'duration': 38,\n",
       "       'instruction': '向南行驶131米左转',\n",
       "       'orientation': '南',\n",
       "       'polyline': '113.679648,23.633689;113.679627,23.63365;113.679596,23.633251;113.679592,23.633173;113.679596,23.632856;113.679596,23.632491',\n",
       "       'road': None,\n",
       "       'tmcs': [{'distance': 48,\n",
       "         'polyline': '113.679648,23.633689;113.679627,23.63365;113.679596,23.633251',\n",
       "         'status': '未知'},\n",
       "        {'distance': 9,\n",
       "         'polyline': '113.679596,23.633251;113.679592,23.633173',\n",
       "         'status': '未知'},\n",
       "        {'distance': 34,\n",
       "         'polyline': '113.679592,23.633173;113.679596,23.632856',\n",
       "         'status': '未知'},\n",
       "        {'distance': 40,\n",
       "         'polyline': '113.679596,23.632856;113.679596,23.632491',\n",
       "         'status': '未知'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0},\n",
       "      {'action': '右转',\n",
       "       'assistant_action': '',\n",
       "       'cities': [{'adcode': '440117',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None}],\n",
       "       'distance': 100,\n",
       "       'duration': 29,\n",
       "       'instruction': '向东行驶100米右转',\n",
       "       'orientation': '东',\n",
       "       'polyline': '113.679596,23.632491;113.680582,23.632522',\n",
       "       'road': None,\n",
       "       'tmcs': [{'distance': 100,\n",
       "         'polyline': '113.679596,23.632491;113.680582,23.632522',\n",
       "         'status': '未知'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0},\n",
       "      {'action': '向右前方行驶',\n",
       "       'assistant_action': '',\n",
       "       'cities': [{'adcode': '440117',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None}],\n",
       "       'distance': 199,\n",
       "       'duration': 48,\n",
       "       'instruction': '向南行驶199米向右前方行驶',\n",
       "       'orientation': '南',\n",
       "       'polyline': '113.680582,23.632522;113.680642,23.632135;113.680668,23.631736;113.680642,23.631589;113.680629,23.631536;113.68059,23.631432;113.680499,23.631237;113.680399,23.631089;113.680204,23.630838',\n",
       "       'road': None,\n",
       "       'tmcs': [{'distance': 122,\n",
       "         'polyline': '113.680582,23.632522;113.680642,23.632135;113.680668,23.631736;113.680642,23.631589;113.680629,23.631536;113.68059,23.631432',\n",
       "         'status': '未知'},\n",
       "        {'distance': 77,\n",
       "         'polyline': '113.68059,23.631432;113.680499,23.631237;113.680399,23.631089;113.680204,23.630838',\n",
       "         'status': '未知'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0},\n",
       "      {'action': '左转',\n",
       "       'assistant_action': '',\n",
       "       'cities': [{'adcode': '440117',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None}],\n",
       "       'distance': 159,\n",
       "       'duration': 35,\n",
       "       'instruction': '向西行驶159米左转',\n",
       "       'orientation': '西',\n",
       "       'polyline': '113.680204,23.630838;113.68003,23.630768;113.67964,23.630634;113.679358,23.630516;113.679197,23.630469;113.678711,23.63036',\n",
       "       'road': None,\n",
       "       'tmcs': [{'distance': 18,\n",
       "         'polyline': '113.680204,23.630838;113.68003,23.630768',\n",
       "         'status': '未知'},\n",
       "        {'distance': 42,\n",
       "         'polyline': '113.68003,23.630768;113.67964,23.630634',\n",
       "         'status': '未知'},\n",
       "        {'distance': 48,\n",
       "         'polyline': '113.67964,23.630634;113.679358,23.630516;113.679197,23.630469',\n",
       "         'status': '未知'},\n",
       "        {'distance': 51,\n",
       "         'polyline': '113.679197,23.630469;113.678711,23.63036',\n",
       "         'status': '未知'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0},\n",
       "      {'action': '左转',\n",
       "       'assistant_action': '',\n",
       "       'cities': [{'adcode': '440117',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None}],\n",
       "       'distance': 237,\n",
       "       'duration': 66,\n",
       "       'instruction': '向南行驶237米左转',\n",
       "       'orientation': '南',\n",
       "       'polyline': '113.678711,23.63036;113.678711,23.629336;113.678698,23.629128;113.678663,23.629054;113.678572,23.628984;113.67842,23.628898;113.678364,23.628837;113.678325,23.628772;113.678299,23.628646;113.678273,23.628372',\n",
       "       'road': None,\n",
       "       'tmcs': [{'distance': 113,\n",
       "         'polyline': '113.678711,23.63036;113.678711,23.629336',\n",
       "         'status': '未知'},\n",
       "        {'distance': 124,\n",
       "         'polyline': '113.678711,23.629336;113.678698,23.629128;113.678663,23.629054;113.678572,23.628984;113.67842,23.628898;113.678364,23.628837;113.678325,23.628772;113.678299,23.628646;113.678273,23.628372',\n",
       "         'status': '未知'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0},\n",
       "      {'action': '向右前方行驶',\n",
       "       'assistant_action': '',\n",
       "       'cities': [{'adcode': '440117',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None}],\n",
       "       'distance': 105,\n",
       "       'duration': 46,\n",
       "       'instruction': '向东南行驶105米向右前方行驶',\n",
       "       'orientation': '东南',\n",
       "       'polyline': '113.678273,23.628372;113.678572,23.628333;113.678689,23.628303;113.678845,23.628234;113.679045,23.628069;113.679162,23.62796',\n",
       "       'road': None,\n",
       "       'tmcs': [{'distance': 43,\n",
       "         'polyline': '113.678273,23.628372;113.678572,23.628333;113.678689,23.628303',\n",
       "         'status': '未知'},\n",
       "        {'distance': 62,\n",
       "         'polyline': '113.678689,23.628303;113.678845,23.628234;113.679045,23.628069;113.679162,23.62796',\n",
       "         'status': '未知'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0},\n",
       "      {'action': '向右前方行驶',\n",
       "       'assistant_action': '',\n",
       "       'cities': [{'adcode': '440117',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None}],\n",
       "       'distance': 393,\n",
       "       'duration': 58,\n",
       "       'instruction': '向南行驶393米向右前方行驶',\n",
       "       'orientation': '南',\n",
       "       'polyline': '113.679162,23.62796;113.679214,23.627865;113.679236,23.627773;113.67928,23.627522;113.679288,23.627318;113.679249,23.626849;113.679184,23.626619;113.679136,23.626493;113.679002,23.62625;113.678937,23.626172;113.678707,23.625972;113.678615,23.625859;113.678529,23.625716;113.678507,23.625634;113.678433,23.625187;113.678424,23.625052;113.678455,23.624931;113.678572,23.624653',\n",
       "       'road': None,\n",
       "       'tmcs': [{'distance': 72,\n",
       "         'polyline': '113.679162,23.62796;113.679214,23.627865;113.679236,23.627773;113.67928,23.627522;113.679288,23.627318',\n",
       "         'status': '未知'},\n",
       "        {'distance': 321,\n",
       "         'polyline': '113.679288,23.627318;113.679249,23.626849;113.679184,23.626619;113.679136,23.626493;113.679002,23.62625;113.678937,23.626172;113.678707,23.625972;113.678615,23.625859;113.678529,23.625716;113.678507,23.625634;113.678433,23.625187;113.678424,23.625052;113.678455,23.624931;113.678572,23.624653',\n",
       "         'status': '畅通'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0},\n",
       "      {'action': '左转',\n",
       "       'assistant_action': '',\n",
       "       'cities': [{'adcode': '440117',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None}],\n",
       "       'distance': 722,\n",
       "       'duration': 96,\n",
       "       'instruction': '向西南行驶722米左转',\n",
       "       'orientation': '西南',\n",
       "       'polyline': '113.678572,23.624653;113.678555,23.624505;113.678411,23.624323;113.677578,23.623789;113.676528,23.623346;113.676354,23.623247;113.676263,23.623147;113.676102,23.62283;113.676037,23.622734;113.675786,23.622474;113.675499,23.62227;113.675412,23.62217;113.675378,23.622083;113.675373,23.621832;113.675391,23.621606;113.675438,23.621471;113.675538,23.621354;113.675764,23.621176;113.675851,23.621085;113.675898,23.62099;113.675911,23.620851;113.675868,23.62072;113.675786,23.620603;113.675742,23.620543;113.675595,23.620369;113.675239,23.620009',\n",
       "       'road': None,\n",
       "       'tmcs': [{'distance': 42,\n",
       "         'polyline': '113.678572,23.624653;113.678555,23.624505;113.678411,23.624323',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 435,\n",
       "         'polyline': '113.678411,23.624323;113.677578,23.623789;113.676528,23.623346;113.676354,23.623247;113.676263,23.623147;113.676102,23.62283;113.676037,23.622734;113.675786,23.622474;113.675499,23.62227;113.675412,23.62217;113.675378,23.622083;113.675373,23.621832',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 245,\n",
       "         'polyline': '113.675373,23.621832;113.675391,23.621606;113.675438,23.621471;113.675538,23.621354;113.675764,23.621176;113.675851,23.621085;113.675898,23.62099;113.675911,23.620851;113.675868,23.62072;113.675786,23.620603;113.675742,23.620543;113.675595,23.620369;113.675239,23.620009',\n",
       "         'status': '未知'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0},\n",
       "      {'action': '向右前方行驶',\n",
       "       'assistant_action': '',\n",
       "       'cities': [{'adcode': '440117',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None}],\n",
       "       'distance': 412,\n",
       "       'duration': 50,\n",
       "       'instruction': '沿乌土街向东南行驶412米向右前方行驶',\n",
       "       'orientation': '东南',\n",
       "       'polyline': '113.675239,23.620009;113.67549,23.620013;113.675642,23.619987;113.675773,23.619944;113.676016,23.619792;113.676897,23.619188;113.677261,23.61878;113.678069,23.617826;113.678186,23.617652',\n",
       "       'road': '乌土街',\n",
       "       'tmcs': [{'distance': 390,\n",
       "         'polyline': '113.675239,23.620009;113.67549,23.620013;113.675642,23.619987;113.675773,23.619944;113.676016,23.619792;113.676897,23.619188;113.677261,23.61878;113.678069,23.617826',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 22,\n",
       "         'polyline': '113.678069,23.617826;113.678186,23.617652',\n",
       "         'status': '畅通'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0},\n",
       "      {'action': '右转',\n",
       "       'assistant_action': '',\n",
       "       'cities': [{'adcode': '440117',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None}],\n",
       "       'distance': 1381,\n",
       "       'duration': 190,\n",
       "       'instruction': '沿乌土街向南行驶1.4千米右转',\n",
       "       'orientation': '南',\n",
       "       'polyline': '113.678186,23.617652;113.678095,23.617201;113.678047,23.61707;113.677969,23.616918;113.677739,23.616554;113.6776,23.616285;113.677387,23.615812;113.677339,23.615664;113.67714,23.614822;113.677049,23.614314;113.676923,23.613355;113.67684,23.612782;113.676593,23.611484;113.676415,23.610434;113.676402,23.61026;113.676489,23.609844;113.676506,23.609618;113.676489,23.609232;113.676411,23.608741;113.676415,23.608481;113.67648,23.608186;113.676606,23.60773;113.676819,23.606732;113.676866,23.606536;113.676918,23.606411;113.677014,23.60625;113.67753,23.605668',\n",
       "       'road': '乌土街',\n",
       "       'tmcs': [{'distance': 844,\n",
       "         'polyline': '113.678186,23.617652;113.678095,23.617201;113.678047,23.61707;113.677969,23.616918;113.677739,23.616554;113.6776,23.616285;113.677387,23.615812;113.677339,23.615664;113.67714,23.614822;113.677049,23.614314;113.676923,23.613355;113.67684,23.612782;113.676593,23.611484;113.676415,23.610434;113.676402,23.61026',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 537,\n",
       "         'polyline': '113.676402,23.61026;113.676489,23.609844;113.676506,23.609618;113.676489,23.609232;113.676411,23.608741;113.676415,23.608481;113.67648,23.608186;113.676606,23.60773;113.676819,23.606732;113.676866,23.606536;113.676918,23.606411;113.677014,23.60625;113.67753,23.605668',\n",
       "         'status': '未知'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0},\n",
       "      {'action': '向左前方行驶',\n",
       "       'assistant_action': '',\n",
       "       'cities': [{'adcode': '440117',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None}],\n",
       "       'distance': 851,\n",
       "       'duration': 107,\n",
       "       'instruction': '沿乌土街途径桃园东路、934县道向西行驶851米向左前方行驶',\n",
       "       'orientation': '西',\n",
       "       'polyline': '113.67753,23.605668;113.676984,23.605369;113.676398,23.605;113.676159,23.604878;113.675799,23.6048;113.675508,23.604774;113.675009,23.604735;113.674232,23.604674;113.673889,23.604614;113.673459,23.604488;113.671671,23.604002;113.671536,23.603954;113.671406,23.60385;113.671059,23.603468;113.670803,23.60326;113.670521,23.603069;113.670191,23.602899;113.670022,23.602795',\n",
       "       'road': '乌土街',\n",
       "       'tmcs': [{'distance': 165,\n",
       "         'polyline': '113.67753,23.605668;113.676984,23.605369;113.676398,23.605;113.676159,23.604878',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 67,\n",
       "         'polyline': '113.676159,23.604878;113.675799,23.6048;113.675508,23.604774',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 51,\n",
       "         'polyline': '113.675508,23.604774;113.675009,23.604735',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 161,\n",
       "         'polyline': '113.675009,23.604735;113.674232,23.604674;113.673889,23.604614;113.673459,23.604488',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 312,\n",
       "         'polyline': '113.673459,23.604488;113.671671,23.604002;113.671536,23.603954;113.671406,23.60385;113.671059,23.603468;113.670803,23.60326',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 74,\n",
       "         'polyline': '113.670803,23.60326;113.670521,23.603069;113.670191,23.602899',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 21,\n",
       "         'polyline': '113.670191,23.602899;113.670022,23.602795',\n",
       "         'status': '畅通'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0},\n",
       "      {'action': '向右前方行驶',\n",
       "       'assistant_action': '',\n",
       "       'cities': [{'adcode': '440117',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None}],\n",
       "       'distance': 106,\n",
       "       'duration': 20,\n",
       "       'instruction': '沿桃园东路向南行驶106米向右前方行驶',\n",
       "       'orientation': '南',\n",
       "       'polyline': '113.670022,23.602795;113.669909,23.602682;113.669809,23.602513;113.669779,23.602409;113.669714,23.601897',\n",
       "       'road': '桃园东路',\n",
       "       'tmcs': [{'distance': 106,\n",
       "         'polyline': '113.670022,23.602795;113.669909,23.602682;113.669809,23.602513;113.669779,23.602409;113.669714,23.601897',\n",
       "         'status': '畅通'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0},\n",
       "      {'action': '右转',\n",
       "       'assistant_action': '',\n",
       "       'cities': [{'adcode': '440117',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None}],\n",
       "       'distance': 165,\n",
       "       'duration': 32,\n",
       "       'instruction': '沿桃园东路向西南行驶165米右转',\n",
       "       'orientation': '西南',\n",
       "       'polyline': '113.669714,23.601897;113.669635,23.601771;113.669484,23.601554;113.66878,23.600855;113.668663,23.600764',\n",
       "       'road': '桃园东路',\n",
       "       'tmcs': [{'distance': 16,\n",
       "         'polyline': '113.669714,23.601897;113.669635,23.601771',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 28,\n",
       "         'polyline': '113.669635,23.601771;113.669484,23.601554',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 121,\n",
       "         'polyline': '113.669484,23.601554;113.66878,23.600855;113.668663,23.600764',\n",
       "         'status': '畅通'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0},\n",
       "      {'action': '左转',\n",
       "       'assistant_action': '',\n",
       "       'cities': [{'adcode': '440117',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None}],\n",
       "       'distance': 48,\n",
       "       'duration': 31,\n",
       "       'instruction': '沿龙岗福安街向西北行驶48米左转',\n",
       "       'orientation': '西北',\n",
       "       'polyline': '113.668663,23.600764;113.668451,23.601003;113.668398,23.60112',\n",
       "       'road': '龙岗福安街',\n",
       "       'tmcs': [{'distance': 48,\n",
       "         'polyline': '113.668663,23.600764;113.668451,23.601003;113.668398,23.60112',\n",
       "         'status': '未知'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0},\n",
       "      {'action': '',\n",
       "       'assistant_action': '到达目的地',\n",
       "       'cities': [{'adcode': '440117',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None}],\n",
       "       'distance': 35,\n",
       "       'duration': 12,\n",
       "       'instruction': '向西行驶35米到达目的地',\n",
       "       'orientation': '西',\n",
       "       'polyline': '113.668398,23.60112;113.668325,23.601094;113.668095,23.601011;113.668077,23.601016',\n",
       "       'road': None,\n",
       "       'tmcs': [{'distance': 8,\n",
       "         'polyline': '113.668398,23.60112;113.668325,23.601094',\n",
       "         'status': '未知'},\n",
       "        {'distance': 27,\n",
       "         'polyline': '113.668325,23.601094;113.668095,23.601011;113.668077,23.601016',\n",
       "         'status': '未知'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0}],\n",
       "     'strategy': '避免拥堵',\n",
       "     'toll_distance': 0,\n",
       "     'tolls': 0,\n",
       "     'traffic_lights': 0},\n",
       "    {'distance': 5846,\n",
       "     'duration': 911,\n",
       "     'restriction': 0,\n",
       "     'steps': [{'action': '右转',\n",
       "       'assistant_action': '',\n",
       "       'cities': [{'adcode': '440117',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None}],\n",
       "       'distance': 116,\n",
       "       'duration': 49,\n",
       "       'instruction': '向东北行驶116米右转',\n",
       "       'orientation': '东北',\n",
       "       'polyline': '113.67872,23.633251;113.679462,23.633911;113.679549,23.633967',\n",
       "       'road': None,\n",
       "       'tmcs': [{'distance': 116,\n",
       "         'polyline': '113.67872,23.633251;113.679462,23.633911;113.679549,23.633967',\n",
       "         'status': '未知'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0},\n",
       "      {'action': '向右前方行驶',\n",
       "       'assistant_action': '',\n",
       "       'cities': [{'adcode': '440117',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None}],\n",
       "       'distance': 32,\n",
       "       'duration': 14,\n",
       "       'instruction': '向南行驶32米向右前方行驶',\n",
       "       'orientation': '南',\n",
       "       'polyline': '113.679549,23.633967;113.679648,23.633689',\n",
       "       'road': None,\n",
       "       'tmcs': [{'distance': 32,\n",
       "         'polyline': '113.679549,23.633967;113.679648,23.633689',\n",
       "         'status': '未知'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0},\n",
       "      {'action': '左转',\n",
       "       'assistant_action': '',\n",
       "       'cities': [{'adcode': '440117',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None}],\n",
       "       'distance': 131,\n",
       "       'duration': 38,\n",
       "       'instruction': '向南行驶131米左转',\n",
       "       'orientation': '南',\n",
       "       'polyline': '113.679648,23.633689;113.679627,23.63365;113.679596,23.633251;113.679592,23.633173;113.679596,23.632856;113.679596,23.632491',\n",
       "       'road': None,\n",
       "       'tmcs': [{'distance': 48,\n",
       "         'polyline': '113.679648,23.633689;113.679627,23.63365;113.679596,23.633251',\n",
       "         'status': '未知'},\n",
       "        {'distance': 9,\n",
       "         'polyline': '113.679596,23.633251;113.679592,23.633173',\n",
       "         'status': '未知'},\n",
       "        {'distance': 34,\n",
       "         'polyline': '113.679592,23.633173;113.679596,23.632856',\n",
       "         'status': '未知'},\n",
       "        {'distance': 40,\n",
       "         'polyline': '113.679596,23.632856;113.679596,23.632491',\n",
       "         'status': '未知'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0},\n",
       "      {'action': '右转',\n",
       "       'assistant_action': '',\n",
       "       'cities': [{'adcode': '440117',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None}],\n",
       "       'distance': 100,\n",
       "       'duration': 29,\n",
       "       'instruction': '向东行驶100米右转',\n",
       "       'orientation': '东',\n",
       "       'polyline': '113.679596,23.632491;113.680582,23.632522',\n",
       "       'road': None,\n",
       "       'tmcs': [{'distance': 100,\n",
       "         'polyline': '113.679596,23.632491;113.680582,23.632522',\n",
       "         'status': '未知'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0},\n",
       "      {'action': '向右前方行驶',\n",
       "       'assistant_action': '',\n",
       "       'cities': [{'adcode': '440117',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None}],\n",
       "       'distance': 199,\n",
       "       'duration': 48,\n",
       "       'instruction': '向南行驶199米向右前方行驶',\n",
       "       'orientation': '南',\n",
       "       'polyline': '113.680582,23.632522;113.680642,23.632135;113.680668,23.631736;113.680642,23.631589;113.680629,23.631536;113.68059,23.631432;113.680499,23.631237;113.680399,23.631089;113.680204,23.630838',\n",
       "       'road': None,\n",
       "       'tmcs': [{'distance': 122,\n",
       "         'polyline': '113.680582,23.632522;113.680642,23.632135;113.680668,23.631736;113.680642,23.631589;113.680629,23.631536;113.68059,23.631432',\n",
       "         'status': '未知'},\n",
       "        {'distance': 77,\n",
       "         'polyline': '113.68059,23.631432;113.680499,23.631237;113.680399,23.631089;113.680204,23.630838',\n",
       "         'status': '未知'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0},\n",
       "      {'action': '左转',\n",
       "       'assistant_action': '',\n",
       "       'cities': [{'adcode': '440117',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None}],\n",
       "       'distance': 159,\n",
       "       'duration': 35,\n",
       "       'instruction': '向西行驶159米左转',\n",
       "       'orientation': '西',\n",
       "       'polyline': '113.680204,23.630838;113.68003,23.630768;113.67964,23.630634;113.679358,23.630516;113.679197,23.630469;113.678711,23.63036',\n",
       "       'road': None,\n",
       "       'tmcs': [{'distance': 18,\n",
       "         'polyline': '113.680204,23.630838;113.68003,23.630768',\n",
       "         'status': '未知'},\n",
       "        {'distance': 42,\n",
       "         'polyline': '113.68003,23.630768;113.67964,23.630634',\n",
       "         'status': '未知'},\n",
       "        {'distance': 48,\n",
       "         'polyline': '113.67964,23.630634;113.679358,23.630516;113.679197,23.630469',\n",
       "         'status': '未知'},\n",
       "        {'distance': 51,\n",
       "         'polyline': '113.679197,23.630469;113.678711,23.63036',\n",
       "         'status': '未知'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0},\n",
       "      {'action': '左转',\n",
       "       'assistant_action': '',\n",
       "       'cities': [{'adcode': '440117',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None}],\n",
       "       'distance': 237,\n",
       "       'duration': 66,\n",
       "       'instruction': '向南行驶237米左转',\n",
       "       'orientation': '南',\n",
       "       'polyline': '113.678711,23.63036;113.678711,23.629336;113.678698,23.629128;113.678663,23.629054;113.678572,23.628984;113.67842,23.628898;113.678364,23.628837;113.678325,23.628772;113.678299,23.628646;113.678273,23.628372',\n",
       "       'road': None,\n",
       "       'tmcs': [{'distance': 113,\n",
       "         'polyline': '113.678711,23.63036;113.678711,23.629336',\n",
       "         'status': '未知'},\n",
       "        {'distance': 124,\n",
       "         'polyline': '113.678711,23.629336;113.678698,23.629128;113.678663,23.629054;113.678572,23.628984;113.67842,23.628898;113.678364,23.628837;113.678325,23.628772;113.678299,23.628646;113.678273,23.628372',\n",
       "         'status': '未知'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0},\n",
       "      {'action': '向右前方行驶',\n",
       "       'assistant_action': '',\n",
       "       'cities': [{'adcode': '440117',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None}],\n",
       "       'distance': 105,\n",
       "       'duration': 46,\n",
       "       'instruction': '向东南行驶105米向右前方行驶',\n",
       "       'orientation': '东南',\n",
       "       'polyline': '113.678273,23.628372;113.678572,23.628333;113.678689,23.628303;113.678845,23.628234;113.679045,23.628069;113.679162,23.62796',\n",
       "       'road': None,\n",
       "       'tmcs': [{'distance': 43,\n",
       "         'polyline': '113.678273,23.628372;113.678572,23.628333;113.678689,23.628303',\n",
       "         'status': '未知'},\n",
       "        {'distance': 62,\n",
       "         'polyline': '113.678689,23.628303;113.678845,23.628234;113.679045,23.628069;113.679162,23.62796',\n",
       "         'status': '未知'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0},\n",
       "      {'action': '向右前方行驶',\n",
       "       'assistant_action': '',\n",
       "       'cities': [{'adcode': '440117',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None}],\n",
       "       'distance': 393,\n",
       "       'duration': 58,\n",
       "       'instruction': '向南行驶393米向右前方行驶',\n",
       "       'orientation': '南',\n",
       "       'polyline': '113.679162,23.62796;113.679214,23.627865;113.679236,23.627773;113.67928,23.627522;113.679288,23.627318;113.679249,23.626849;113.679184,23.626619;113.679136,23.626493;113.679002,23.62625;113.678937,23.626172;113.678707,23.625972;113.678615,23.625859;113.678529,23.625716;113.678507,23.625634;113.678433,23.625187;113.678424,23.625052;113.678455,23.624931;113.678572,23.624653',\n",
       "       'road': None,\n",
       "       'tmcs': [{'distance': 72,\n",
       "         'polyline': '113.679162,23.62796;113.679214,23.627865;113.679236,23.627773;113.67928,23.627522;113.679288,23.627318',\n",
       "         'status': '未知'},\n",
       "        {'distance': 321,\n",
       "         'polyline': '113.679288,23.627318;113.679249,23.626849;113.679184,23.626619;113.679136,23.626493;113.679002,23.62625;113.678937,23.626172;113.678707,23.625972;113.678615,23.625859;113.678529,23.625716;113.678507,23.625634;113.678433,23.625187;113.678424,23.625052;113.678455,23.624931;113.678572,23.624653',\n",
       "         'status': '畅通'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0},\n",
       "      {'action': '左转',\n",
       "       'assistant_action': '',\n",
       "       'cities': [{'adcode': '440117',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None}],\n",
       "       'distance': 2351,\n",
       "       'duration': 254,\n",
       "       'instruction': '沿源富街途径源湖街向西南行驶2.4千米左转',\n",
       "       'orientation': '西南',\n",
       "       'polyline': '113.678572,23.624653;113.678555,23.624505;113.678411,23.624323;113.677578,23.623789;113.676528,23.623346;113.676354,23.623247;113.676263,23.623147;113.676102,23.62283;113.676037,23.622734;113.675786,23.622474;113.675499,23.62227;113.675412,23.62217;113.675378,23.622083;113.675373,23.621832;113.675391,23.621606;113.675438,23.621471;113.675538,23.621354;113.675764,23.621176;113.675851,23.621085;113.675898,23.62099;113.675911,23.620851;113.675868,23.62072;113.675786,23.620603;113.675742,23.620543;113.675595,23.620369;113.675239,23.620009;113.674931,23.619714;113.673919,23.61862;113.673689,23.618429;113.673459,23.618333;113.673216,23.618268;113.671081,23.617786;113.667895,23.617096;113.666341,23.616736;113.665916,23.616649;113.664549,23.616345;113.663585,23.616128;113.663507,23.616107;113.663225,23.616042;113.662569,23.615911;113.662027,23.615803;113.661684,23.615712;113.660404,23.615417',\n",
       "       'road': '源富街',\n",
       "       'tmcs': [{'distance': 42,\n",
       "         'polyline': '113.678572,23.624653;113.678555,23.624505;113.678411,23.624323',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 435,\n",
       "         'polyline': '113.678411,23.624323;113.677578,23.623789;113.676528,23.623346;113.676354,23.623247;113.676263,23.623147;113.676102,23.62283;113.676037,23.622734;113.675786,23.622474;113.675499,23.62227;113.675412,23.62217;113.675378,23.622083;113.675373,23.621832',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 245,\n",
       "         'polyline': '113.675373,23.621832;113.675391,23.621606;113.675438,23.621471;113.675538,23.621354;113.675764,23.621176;113.675851,23.621085;113.675898,23.62099;113.675911,23.620851;113.675868,23.62072;113.675786,23.620603;113.675742,23.620543;113.675595,23.620369;113.675239,23.620009',\n",
       "         'status': '未知'},\n",
       "        {'distance': 512,\n",
       "         'polyline': '113.675239,23.620009;113.674931,23.619714;113.673919,23.61862;113.673689,23.618429;113.673459,23.618333;113.673216,23.618268;113.671081,23.617786',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 334,\n",
       "         'polyline': '113.671081,23.617786;113.667895,23.617096',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 163,\n",
       "         'polyline': '113.667895,23.617096;113.666341,23.616736',\n",
       "         'status': '未知'},\n",
       "        {'distance': 44,\n",
       "         'polyline': '113.666341,23.616736;113.665916,23.616649',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 244,\n",
       "         'polyline': '113.665916,23.616649;113.664549,23.616345;113.663585,23.616128',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 8,\n",
       "         'polyline': '113.663585,23.616128;113.663507,23.616107',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 29,\n",
       "         'polyline': '113.663507,23.616107;113.663225,23.616042',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 68,\n",
       "         'polyline': '113.663225,23.616042;113.662569,23.615911',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 93,\n",
       "         'polyline': '113.662569,23.615911;113.662027,23.615803;113.661684,23.615712',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 134,\n",
       "         'polyline': '113.661684,23.615712;113.660404,23.615417',\n",
       "         'status': '未知'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0},\n",
       "      {'action': '左转',\n",
       "       'assistant_action': '',\n",
       "       'cities': [{'adcode': '440117',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None}],\n",
       "       'distance': 1858,\n",
       "       'duration': 209,\n",
       "       'instruction': '沿龙泉路向东南行驶1.9千米左转',\n",
       "       'orientation': '东南',\n",
       "       'polyline': '113.660404,23.615417;113.660872,23.61513;113.661315,23.614831;113.661619,23.614596;113.661667,23.614527;113.661736,23.614349;113.661797,23.614145;113.661862,23.614006;113.661914,23.613937;113.662079,23.613789;113.662613,23.613381;113.662756,23.61322;113.662804,23.613142;113.66434,23.609618;113.664549,23.609128;113.665095,23.607891;113.665694,23.606523;113.667018,23.602865;113.667179,23.602465;113.667361,23.601984;113.667465,23.601688;113.667565,23.601437;113.667665,23.601159;113.667773,23.600877;113.667943,23.600412',\n",
       "       'road': '龙泉路',\n",
       "       'tmcs': [{'distance': 113,\n",
       "         'polyline': '113.660404,23.615417;113.660872,23.61513;113.661315,23.614831',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 70,\n",
       "         'polyline': '113.661315,23.614831;113.661619,23.614596;113.661667,23.614527;113.661736,23.614349',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 23,\n",
       "         'polyline': '113.661736,23.614349;113.661797,23.614145',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 153,\n",
       "         'polyline': '113.661797,23.614145;113.661862,23.614006;113.661914,23.613937;113.662079,23.613789;113.662613,23.613381;113.662756,23.61322;113.662804,23.613142',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 626,\n",
       "         'polyline': '113.662804,23.613142;113.66434,23.609618;113.664549,23.609128;113.665095,23.607891',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 163,\n",
       "         'polyline': '113.665095,23.607891;113.665694,23.606523',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 426,\n",
       "         'polyline': '113.665694,23.606523;113.667018,23.602865',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 47,\n",
       "         'polyline': '113.667018,23.602865;113.667179,23.602465',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 56,\n",
       "         'polyline': '113.667179,23.602465;113.667361,23.601984',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 34,\n",
       "         'polyline': '113.667361,23.601984;113.667465,23.601688',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 29,\n",
       "         'polyline': '113.667465,23.601688;113.667565,23.601437',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 32,\n",
       "         'polyline': '113.667565,23.601437;113.667665,23.601159',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 32,\n",
       "         'polyline': '113.667665,23.601159;113.667773,23.600877',\n",
       "         'status': '畅通'},\n",
       "        {'distance': 54,\n",
       "         'polyline': '113.667773,23.600877;113.667943,23.600412',\n",
       "         'status': '畅通'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0},\n",
       "      {'action': '左转',\n",
       "       'assistant_action': '',\n",
       "       'cities': [{'adcode': '440117',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None}],\n",
       "       'distance': 82,\n",
       "       'duration': 22,\n",
       "       'instruction': '沿桃园东路向东北行驶82米左转',\n",
       "       'orientation': '东北',\n",
       "       'polyline': '113.667943,23.600412;113.668437,23.600642;113.668663,23.600764',\n",
       "       'road': '桃园东路',\n",
       "       'tmcs': [{'distance': 82,\n",
       "         'polyline': '113.667943,23.600412;113.668437,23.600642;113.668663,23.600764',\n",
       "         'status': '畅通'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0},\n",
       "      {'action': '左转',\n",
       "       'assistant_action': '',\n",
       "       'cities': [{'adcode': '440117',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None}],\n",
       "       'distance': 48,\n",
       "       'duration': 31,\n",
       "       'instruction': '沿龙岗福安街向西北行驶48米左转',\n",
       "       'orientation': '西北',\n",
       "       'polyline': '113.668663,23.600764;113.668451,23.601003;113.668398,23.60112',\n",
       "       'road': '龙岗福安街',\n",
       "       'tmcs': [{'distance': 48,\n",
       "         'polyline': '113.668663,23.600764;113.668451,23.601003;113.668398,23.60112',\n",
       "         'status': '未知'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0},\n",
       "      {'action': '',\n",
       "       'assistant_action': '到达目的地',\n",
       "       'cities': [{'adcode': '440117',\n",
       "         'citycode': None,\n",
       "         'districts': [],\n",
       "         'name': None},\n",
       "        {'adcode': '440117', 'citycode': None, 'districts': [], 'name': None}],\n",
       "       'distance': 35,\n",
       "       'duration': 12,\n",
       "       'instruction': '向西行驶35米到达目的地',\n",
       "       'orientation': '西',\n",
       "       'polyline': '113.668398,23.60112;113.668325,23.601094;113.668095,23.601011;113.668077,23.601016',\n",
       "       'road': None,\n",
       "       'tmcs': [{'distance': 8,\n",
       "         'polyline': '113.668398,23.60112;113.668325,23.601094',\n",
       "         'status': '未知'},\n",
       "        {'distance': 27,\n",
       "         'polyline': '113.668325,23.601094;113.668095,23.601011;113.668077,23.601016',\n",
       "         'status': '未知'}],\n",
       "       'toll_distance': 0,\n",
       "       'toll_road': '',\n",
       "       'tolls': 0}],\n",
       "     'strategy': '避免拥堵',\n",
       "     'toll_distance': 0,\n",
       "     'tolls': 0,\n",
       "     'traffic_lights': 0}]},\n",
       "  'count': 2},\n",
       " 'errcode': 0,\n",
       " 'errdetail': None,\n",
       " 'errmsg': 'OK',\n",
       " 'ext': None}"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "origin='113.678600,23.633329'\n",
    "location='113.668051,23.600869'\n",
    "size='2'\n",
    "truck(key,origin,location,size)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "ename": "KeyError",
     "evalue": "'data'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mKeyError\u001b[0m                                  Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-31-4a68bb99a02e>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0ma\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mtruck\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0morigin\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mlocation\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0msize\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'data'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'route'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'paths'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'steps'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m      2\u001b[0m \u001b[0mpd\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mjson_normalize\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0ma\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'instruction'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mKeyError\u001b[0m: 'data'"
     ]
    }
   ],
   "source": [
    "a=truck(key,origin,location,size)['data']['route']['paths'][0]['steps']\n",
    "pd.json_normalize(a)['instruction']"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "3.5测量距离"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [],
   "source": [
    "def distance(origins,location,type=''):\n",
    "    #测量距离\n",
    "    url='https://restapi.amap.com/v3/distance?parameters'\n",
    "    key='de6216071f58b9c3b96bf20013f009e2'\n",
    "    params={\n",
    "        'key':key,\n",
    "        'origins':origins,\n",
    "        'destination':location, \n",
    "        'type':type\n",
    "      \n",
    "    }\n",
    "    response=requests.get(url,params)\n",
    "    results=response.json()\n",
    "    return results"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000',\n",
       " 'results': [{'origin_id': '1',\n",
       "   'dest_id': '1',\n",
       "   'distance': '5846',\n",
       "   'duration': '900'}]}"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "origins='113.678600,23.633329'\n",
    "location='113.668051,23.600869'\n",
    "type='0'\n",
    "distance(origin,location)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "4.行政区域查询"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [],
   "source": [
    "def district(key,keywords=None,subdistrict='1',page='1',offset='20',extensions='base',filter='',callback=None,output='json'):\n",
    "    #行政区域查询\n",
    "    url='https://restapi.amap.com/v3/config/district?parameters'\n",
    "    params={\n",
    "        'key':key,\n",
    "        'keywords':keywords,\n",
    "        'subdistrict':subdistrict,\n",
    "        'extensions':extensions,\n",
    "        'page':page,\n",
    "        'offset':offset,\n",
    "        'filter':filter,\n",
    "        'callback':callback,\n",
    "        'output':output     \n",
    "    }\n",
    "    response=requests.get(url,params)\n",
    "    results=response.json()\n",
    "    return results"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000',\n",
       " 'count': '1',\n",
       " 'suggestion': {'keywords': [], 'cities': []},\n",
       " 'districts': [{'citycode': [],\n",
       "   'adcode': '450000',\n",
       "   'name': '广西壮族自治区',\n",
       "   'center': '108.320004,22.82402',\n",
       "   'level': 'province',\n",
       "   'districts': [{'citycode': '0776',\n",
       "     'adcode': '451000',\n",
       "     'name': '百色市',\n",
       "     'center': '106.616285,23.897742',\n",
       "     'level': 'city',\n",
       "     'districts': []},\n",
       "    {'citycode': '0779',\n",
       "     'adcode': '450500',\n",
       "     'name': '北海市',\n",
       "     'center': '109.119254,21.473343',\n",
       "     'level': 'city',\n",
       "     'districts': []},\n",
       "    {'citycode': '0777',\n",
       "     'adcode': '450700',\n",
       "     'name': '钦州市',\n",
       "     'center': '108.624175,21.967127',\n",
       "     'level': 'city',\n",
       "     'districts': []},\n",
       "    {'citycode': '0772',\n",
       "     'adcode': '450200',\n",
       "     'name': '柳州市',\n",
       "     'center': '109.411703,24.314617',\n",
       "     'level': 'city',\n",
       "     'districts': []},\n",
       "    {'citycode': '1772',\n",
       "     'adcode': '451300',\n",
       "     'name': '来宾市',\n",
       "     'center': '109.229772,23.733766',\n",
       "     'level': 'city',\n",
       "     'districts': []},\n",
       "    {'citycode': '0771',\n",
       "     'adcode': '450100',\n",
       "     'name': '南宁市',\n",
       "     'center': '108.320004,22.82402',\n",
       "     'level': 'city',\n",
       "     'districts': []},\n",
       "    {'citycode': '0774',\n",
       "     'adcode': '450400',\n",
       "     'name': '梧州市',\n",
       "     'center': '111.297604,23.474803',\n",
       "     'level': 'city',\n",
       "     'districts': []},\n",
       "    {'citycode': '0773',\n",
       "     'adcode': '450300',\n",
       "     'name': '桂林市',\n",
       "     'center': '110.299121,25.274215',\n",
       "     'level': 'city',\n",
       "     'districts': []},\n",
       "    {'citycode': '1771',\n",
       "     'adcode': '451400',\n",
       "     'name': '崇左市',\n",
       "     'center': '107.353926,22.404108',\n",
       "     'level': 'city',\n",
       "     'districts': []},\n",
       "    {'citycode': '0770',\n",
       "     'adcode': '450600',\n",
       "     'name': '防城港市',\n",
       "     'center': '108.345478,21.614631',\n",
       "     'level': 'city',\n",
       "     'districts': []},\n",
       "    {'citycode': '1774',\n",
       "     'adcode': '451100',\n",
       "     'name': '贺州市',\n",
       "     'center': '111.552056,24.414141',\n",
       "     'level': 'city',\n",
       "     'districts': []},\n",
       "    {'citycode': '0775',\n",
       "     'adcode': '450900',\n",
       "     'name': '玉林市',\n",
       "     'center': '110.154393,22.63136',\n",
       "     'level': 'city',\n",
       "     'districts': []},\n",
       "    {'citycode': '1755',\n",
       "     'adcode': '450800',\n",
       "     'name': '贵港市',\n",
       "     'center': '109.602146,23.0936',\n",
       "     'level': 'city',\n",
       "     'districts': []},\n",
       "    {'citycode': '0778',\n",
       "     'adcode': '451200',\n",
       "     'name': '河池市',\n",
       "     'center': '108.062105,24.695899',\n",
       "     'level': 'city',\n",
       "     'districts': []}]}]}"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "key='de6216071f58b9c3b96bf20013f009e2'\n",
    "keywords='广西'\n",
    "subdistrict='1'\n",
    "district(key,keywords,subdistrict='1',page='1',offset='20',extensions='base',filter='',callback=None,output='json')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "找出各个城市名字"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0      百色市\n",
       "1      北海市\n",
       "2      钦州市\n",
       "3      柳州市\n",
       "4      来宾市\n",
       "5      南宁市\n",
       "6      梧州市\n",
       "7      桂林市\n",
       "8      崇左市\n",
       "9     防城港市\n",
       "10     贺州市\n",
       "11     玉林市\n",
       "12     贵港市\n",
       "13     河池市\n",
       "Name: name, dtype: object"
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a=district(key,keywords,subdistrict='1',page='1',offset='20',extensions='base',filter='',callback=None,output='json')['districts'][0]['districts']\n",
    "import pandas as pd\n",
    "pd.json_normalize(a)['name']"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 5.搜索POI"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "5.1关键词搜索"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [],
   "source": [
    "def text(keywords,city='',extensions='',citylimit=''):\n",
    "    #关键词搜索\n",
    "    url='https://restapi.amap.com/v3/place/text?parameters'\n",
    "    key='18ef7dd6aeefc21dade574262c00f213'\n",
    "    params={\n",
    "        'key':key,\n",
    "        'keywords':keywords,\n",
    "        'city':city,\n",
    "        'extensions':extensions,\n",
    "        'citylimit':citylimit\n",
    "      \n",
    "    }\n",
    "    response=requests.get(url,params)\n",
    "    results=response.json()\n",
    "    return results"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'suggestion': {'keywords': [], 'cities': []},\n",
       " 'count': '890',\n",
       " 'infocode': '10000',\n",
       " 'pois': [{'parent': [],\n",
       "   'address': '杭州路36-1号',\n",
       "   'distance': [],\n",
       "   'biz_ext': [],\n",
       "   'pname': '广西壮族自治区',\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '南宁市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '兴宁区',\n",
       "   'name': '陆川风味馆(杭州路店)',\n",
       "   'location': '108.315607,22.823187',\n",
       "   'tel': '0771-2424809;13978805863',\n",
       "   'shopid': [],\n",
       "   'id': 'B03030554G'},\n",
       "  {'parent': 'B0303077E7',\n",
       "   'address': '人民路210号福莱阁1层',\n",
       "   'distance': [],\n",
       "   'biz_ext': [],\n",
       "   'pname': '广西壮族自治区',\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '南宁市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': '202',\n",
       "   'adname': '兴宁区',\n",
       "   'name': '粉之都桂林米粉(友爱路店)',\n",
       "   'location': '108.323360,22.823336',\n",
       "   'tel': '0771-2635530;0771-2914891',\n",
       "   'shopid': [],\n",
       "   'id': 'B030302B34'},\n",
       "  {'parent': [],\n",
       "   'address': '苏州路25号',\n",
       "   'distance': [],\n",
       "   'biz_ext': [],\n",
       "   'pname': '广西壮族自治区',\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '南宁市',\n",
       "   'type': '餐饮服务;中餐厅;湖南菜(湘菜)',\n",
       "   'photos': [],\n",
       "   'typecode': '050108',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '兴宁区',\n",
       "   'name': '韶山冲湘菜馆(朝阳店)',\n",
       "   'location': '108.319456,22.822995',\n",
       "   'tel': '15307851616;18277195346',\n",
       "   'shopid': [],\n",
       "   'id': 'B03030TPCW'},\n",
       "  {'parent': [],\n",
       "   'address': '朝阳街道朝阳路76号维也纳酒店22楼',\n",
       "   'distance': [],\n",
       "   'biz_ext': [],\n",
       "   'pname': '广西壮族自治区',\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '南宁市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '兴宁区',\n",
       "   'name': '百味阁旋转餐厅(朝阳店)',\n",
       "   'location': '108.318774,22.823341',\n",
       "   'tel': '0771-6771808',\n",
       "   'shopid': [],\n",
       "   'id': 'B03030VNZD'},\n",
       "  {'parent': [],\n",
       "   'address': [],\n",
       "   'distance': [],\n",
       "   'biz_ext': [],\n",
       "   'pname': '广西壮族自治区',\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '南宁市',\n",
       "   'type': '餐饮服务;中餐厅;综合酒楼',\n",
       "   'photos': [],\n",
       "   'typecode': '050101',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '兴宁区',\n",
       "   'name': '桂盟大酒楼',\n",
       "   'location': '108.322391,22.825929',\n",
       "   'tel': '13978664684',\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFHS2LXC'},\n",
       "  {'parent': [],\n",
       "   'address': '人民东路140、142号',\n",
       "   'distance': [],\n",
       "   'biz_ext': [],\n",
       "   'pname': '广西壮族自治区',\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '南宁市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '兴宁区',\n",
       "   'name': '飘香炖品',\n",
       "   'location': '108.325092,22.824598',\n",
       "   'tel': '19163771907;18333760019',\n",
       "   'shopid': [],\n",
       "   'id': 'B030305YIG'},\n",
       "  {'parent': 'B0FFIP0V6O',\n",
       "   'address': '朝阳路9号百盛步行街广场六层',\n",
       "   'distance': [],\n",
       "   'biz_ext': [],\n",
       "   'pname': '广西壮族自治区',\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '南宁市',\n",
       "   'type': '餐饮服务;中餐厅;火锅店',\n",
       "   'photos': [],\n",
       "   'typecode': '050117',\n",
       "   'shopinfo': '1',\n",
       "   'poiweight': [],\n",
       "   'childtype': '202',\n",
       "   'adname': '兴宁区',\n",
       "   'name': '海底捞火锅(百盛步行街广场店)',\n",
       "   'location': '108.321543,22.813767',\n",
       "   'tel': '0771-2865216;0771-2865092',\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFIDKIFT'},\n",
       "  {'parent': 'B03030TFVG',\n",
       "   'address': '朝阳路38号新朝阳商业广场地上第三层第A3001、A3002、A3008、A3009号',\n",
       "   'distance': [],\n",
       "   'biz_ext': [],\n",
       "   'pname': '广西壮族自治区',\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '南宁市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': '202',\n",
       "   'adname': '兴宁区',\n",
       "   'name': '蛙有道(新朝阳广场店)',\n",
       "   'location': '108.321295,22.817228',\n",
       "   'tel': '0771-3110799;17736605004',\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFI3356F'},\n",
       "  {'parent': [],\n",
       "   'address': '朝阳街道中华路47-15号',\n",
       "   'distance': [],\n",
       "   'biz_ext': [],\n",
       "   'pname': '广西壮族自治区',\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '南宁市',\n",
       "   'type': '餐饮服务;中餐厅;火锅店',\n",
       "   'photos': [],\n",
       "   'typecode': '050117',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '兴宁区',\n",
       "   'name': '老北京涮羊肉店(中华店)',\n",
       "   'location': '108.323637,22.829579',\n",
       "   'tel': '0771-2432491;0771-2428629',\n",
       "   'shopid': [],\n",
       "   'id': 'B030302L6A'},\n",
       "  {'parent': [],\n",
       "   'address': '杭州路38-1号',\n",
       "   'distance': [],\n",
       "   'biz_ext': [],\n",
       "   'pname': '广西壮族自治区',\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '南宁市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '兴宁区',\n",
       "   'name': '盈盈酒家',\n",
       "   'location': '108.315545,22.823296',\n",
       "   'tel': '0771-2433836',\n",
       "   'shopid': [],\n",
       "   'id': 'B030305530'},\n",
       "  {'parent': 'B0303071GJ',\n",
       "   'address': '朝阳路76号南方大厦1层',\n",
       "   'distance': [],\n",
       "   'biz_ext': [],\n",
       "   'pname': '广西壮族自治区',\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '南宁市',\n",
       "   'type': '餐饮服务;快餐厅;麦当劳',\n",
       "   'photos': [],\n",
       "   'typecode': '050302',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': '202',\n",
       "   'adname': '兴宁区',\n",
       "   'name': '麦当劳',\n",
       "   'location': '108.317946,22.822833',\n",
       "   'tel': '0771-2448381;13014999696',\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFFSAWF7'},\n",
       "  {'parent': 'B0303005C9',\n",
       "   'address': '杭州路3号广西南宁天湖酒店',\n",
       "   'distance': [],\n",
       "   'biz_ext': [],\n",
       "   'pname': '广西壮族自治区',\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '南宁市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': '202',\n",
       "   'adname': '兴宁区',\n",
       "   'name': '天湖酒店大宴会厅',\n",
       "   'location': '108.315566,22.823982',\n",
       "   'tel': '0771-2195588',\n",
       "   'shopid': [],\n",
       "   'id': 'B030305OBW'},\n",
       "  {'parent': 'B03030TFVG',\n",
       "   'address': '朝阳路38号新朝阳商业广场3楼(百盛、万达广场、肯德基楼上)',\n",
       "   'distance': [],\n",
       "   'biz_ext': [],\n",
       "   'pname': '广西壮族自治区',\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '南宁市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': '201',\n",
       "   'adname': '兴宁区',\n",
       "   'name': '比巴卜自助烤涮餐厅(新朝阳商业广场)',\n",
       "   'location': '108.321282,22.817098',\n",
       "   'tel': '0771-5798069',\n",
       "   'shopid': [],\n",
       "   'id': 'B03030TOKH'},\n",
       "  {'parent': [],\n",
       "   'address': '人民东路58号(近人民公园正门)',\n",
       "   'distance': [],\n",
       "   'biz_ext': [],\n",
       "   'pname': '广西壮族自治区',\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '南宁市',\n",
       "   'type': '餐饮服务;中餐厅;综合酒楼',\n",
       "   'photos': [],\n",
       "   'typecode': '050101',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '兴宁区',\n",
       "   'name': '大英雄公园酒楼',\n",
       "   'location': '108.325804,22.825774',\n",
       "   'tel': '0771-2806968;0771-2808268',\n",
       "   'shopid': [],\n",
       "   'id': 'B03030772K'},\n",
       "  {'parent': [],\n",
       "   'address': '民生街道人民东路148号',\n",
       "   'distance': [],\n",
       "   'biz_ext': [],\n",
       "   'pname': '广西壮族自治区',\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '南宁市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '兴宁区',\n",
       "   'name': '方太美食',\n",
       "   'location': '108.324979,22.824448',\n",
       "   'tel': '13807717084',\n",
       "   'shopid': [],\n",
       "   'id': 'B030302IW1'},\n",
       "  {'parent': 'B030307CT4',\n",
       "   'address': '中华路82号南宁站1层',\n",
       "   'distance': [],\n",
       "   'biz_ext': [],\n",
       "   'pname': '广西壮族自治区',\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '南宁市',\n",
       "   'type': '餐饮服务;快餐厅;肯德基',\n",
       "   'photos': [],\n",
       "   'typecode': '050301',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': '201',\n",
       "   'adname': '西乡塘区',\n",
       "   'name': '肯德基',\n",
       "   'location': '108.315121,22.826357',\n",
       "   'tel': '4009200715',\n",
       "   'shopid': [],\n",
       "   'id': 'B0GRKA40E9'},\n",
       "  {'parent': [],\n",
       "   'address': '衡阳西路1号广运都市景苑1楼商铺',\n",
       "   'distance': [],\n",
       "   'biz_ext': [],\n",
       "   'pname': '广西壮族自治区',\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '南宁市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '西乡塘区',\n",
       "   'name': '李记猪肚鸡(衡阳路四分店)',\n",
       "   'location': '108.315419,22.834498',\n",
       "   'tel': '0771-3902183;18376603482;0771-3304883',\n",
       "   'shopid': [],\n",
       "   'id': 'B030305FVH'},\n",
       "  {'parent': 'B03030TFVG',\n",
       "   'address': '朝阳路38号新朝阳商业广场4楼',\n",
       "   'distance': [],\n",
       "   'biz_ext': [],\n",
       "   'pname': '广西壮族自治区',\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '南宁市',\n",
       "   'type': '餐饮服务;外国餐厅;韩国料理',\n",
       "   'photos': [],\n",
       "   'typecode': '050203',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': '201',\n",
       "   'adname': '兴宁区',\n",
       "   'name': '韩尚馆(朝阳店)',\n",
       "   'location': '108.321759,22.816652',\n",
       "   'tel': '0771-5798224',\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFF36VT3'},\n",
       "  {'parent': 'B0303054XG',\n",
       "   'address': '青云街18号南宁悦荟广场A座4层410号',\n",
       "   'distance': [],\n",
       "   'biz_ext': [],\n",
       "   'pname': '广西壮族自治区',\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '南宁市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': '202',\n",
       "   'adname': '兴宁区',\n",
       "   'name': '鱼上餐厅(悦荟店)',\n",
       "   'location': '108.322373,22.813986',\n",
       "   'tel': '0771-2811518',\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFGH60EP'},\n",
       "  {'parent': [],\n",
       "   'address': '新华街南宁市百佳汇流行前线商场加勒比食街8-25铺半亩地',\n",
       "   'distance': [],\n",
       "   'biz_ext': [],\n",
       "   'pname': '广西壮族自治区',\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '南宁市',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'photos': [],\n",
       "   'typecode': '050100',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '兴宁区',\n",
       "   'name': '半亩地螺蛳粉(朝阳广场店)',\n",
       "   'location': '108.321316,22.819983',\n",
       "   'tel': '18776735098',\n",
       "   'shopid': [],\n",
       "   'id': 'B0303074A8'}],\n",
       " 'status': '1',\n",
       " 'info': 'OK'}"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "keywords='美食'\n",
    "city='广西'\n",
    "citylimit='true'\n",
    "text(keywords,city,extensions,citylimit)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "5.2周边搜索"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [],
   "source": [
    "def around(location,keywords=''):\n",
    "    #周边搜索\n",
    "    url='https://restapi.amap.com/v3/place/around?parameters '\n",
    "    key='de6216071f58b9c3b96bf20013f009e2'\n",
    "    params={\n",
    "        'key':key,\n",
    "        'keywords':keywords,\n",
    "        'location':location\n",
    "      \n",
    "    }\n",
    "    response=requests.get(url,params)\n",
    "    results=response.json()\n",
    "    return results"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'suggestion': {'keywords': [], 'cities': []},\n",
       " 'count': '172',\n",
       " 'infocode': '10000',\n",
       " 'pois': [{'parent': [],\n",
       "   'address': '朝阳路29号西南1层附近',\n",
       "   'distance': '109',\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'pname': '广西壮族自治区',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '南宁市',\n",
       "   'type': '公司企业;公司;公司',\n",
       "   'photos': [],\n",
       "   'typecode': '170200',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '兴宁区',\n",
       "   'name': '南宁万达国际电影城有限公司',\n",
       "   'location': '108.321510,22.815693',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFIDTAIC'},\n",
       "  {'parent': [],\n",
       "   'address': '朝阳路29号西南商都818号',\n",
       "   'distance': '152',\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'pname': '广西壮族自治区',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '南宁市',\n",
       "   'type': '购物服务;购物相关场所;购物相关场所',\n",
       "   'photos': [],\n",
       "   'typecode': '060000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '兴宁区',\n",
       "   'name': 'TD私人影院朝阳步行街店(兴宁路)',\n",
       "   'location': '108.321096,22.815424',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0G3VPCC1U'},\n",
       "  {'parent': 'B030305ATI',\n",
       "   'address': '朝阳路45号南宁百货大楼北楼8楼',\n",
       "   'distance': '201',\n",
       "   'biz_ext': {'cost': [], 'seat_ordering': '0', 'rating': '3.5'},\n",
       "   'pname': '广西壮族自治区',\n",
       "   'importance': [],\n",
       "   'biz_type': 'cinema',\n",
       "   'cityname': '南宁市',\n",
       "   'type': '体育休闲服务;影剧院;电影院',\n",
       "   'photos': [{'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/b7bebeac10f861f0d408a4f639512a8e'},\n",
       "    {'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/fc4e47a3f0ec3d1582804a67c75d02b1'},\n",
       "    {'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/a87acc5a073366c2b4e904dfa85350a3'}],\n",
       "   'typecode': '080601',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': '202',\n",
       "   'adname': '兴宁区',\n",
       "   'name': '中影南百国际影城',\n",
       "   'location': '108.320324,22.817889',\n",
       "   'tel': '0771-2872618;0771-2872378',\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFLCSNPH'},\n",
       "  {'parent': 'B0303074RU',\n",
       "   'address': '共和路99号格兰云天21层21G号',\n",
       "   'distance': '289',\n",
       "   'biz_ext': {'cost': [], 'seat_ordering': '0', 'rating': '3.5'},\n",
       "   'pname': '广西壮族自治区',\n",
       "   'importance': [],\n",
       "   'biz_type': 'cinema',\n",
       "   'cityname': '南宁市',\n",
       "   'type': '体育休闲服务;影剧院;电影院',\n",
       "   'photos': [{'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/7a916f45a94aa127b5e4cf803bdcdff7'},\n",
       "    {'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/4b4b0632c49bb7f3a7c84e0d7fb13fb4'},\n",
       "    {'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/25e663b932d4a6131e6f1c2fecfbc5d3'}],\n",
       "   'typecode': '080601',\n",
       "   'shopinfo': '1',\n",
       "   'poiweight': [],\n",
       "   'childtype': '202',\n",
       "   'adname': '兴宁区',\n",
       "   'name': 'TD私人影院(朝阳店)',\n",
       "   'location': '108.323857,22.814914',\n",
       "   'tel': '17776663571',\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFLLKKKF'},\n",
       "  {'parent': [],\n",
       "   'address': '兴宁路步行街59号',\n",
       "   'distance': '289',\n",
       "   'biz_ext': {'cost': [], 'seat_ordering': '0', 'rating': '4.5'},\n",
       "   'pname': '广西壮族自治区',\n",
       "   'importance': [],\n",
       "   'biz_type': 'cinema',\n",
       "   'cityname': '南宁市',\n",
       "   'type': '体育休闲服务;影剧院;电影院',\n",
       "   'photos': [{'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/0384b8a3027ea216a93c2b03b17d5ad7'},\n",
       "    {'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/a18fd5848602848c6b09032408545cd0'},\n",
       "    {'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/dc0dad74a423963ba44357fbc94a3e28'}],\n",
       "   'typecode': '080601',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '兴宁区',\n",
       "   'name': '金逸影城(步行街店)',\n",
       "   'location': '108.320733,22.814227',\n",
       "   'tel': '0771-2825195;0771-2825186',\n",
       "   'shopid': [],\n",
       "   'id': 'B03030TLD0'},\n",
       "  {'parent': 'B030305ZGF',\n",
       "   'address': '青云街18号悦荟广场B座3层',\n",
       "   'distance': '297',\n",
       "   'biz_ext': {'cost': '40.00', 'seat_ordering': '0', 'rating': '5.0'},\n",
       "   'pname': '广西壮族自治区',\n",
       "   'importance': [],\n",
       "   'biz_type': 'cinema',\n",
       "   'cityname': '南宁市',\n",
       "   'type': '体育休闲服务;影剧院;电影院',\n",
       "   'photos': [{'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/e5b68c64cd1e1d094f7f16f5c531623e'},\n",
       "    {'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/a8d74c37e15b4e735f8f45c04862111e'},\n",
       "    {'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/e76138d962e33a68cfd51c068f025ddd'}],\n",
       "   'typecode': '080601',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': '202',\n",
       "   'adname': '兴宁区',\n",
       "   'name': '万达影城(南宁悦荟广场店)',\n",
       "   'location': '108.323611,22.814595',\n",
       "   'tel': '0771-2617770;4000806060',\n",
       "   'shopid': [],\n",
       "   'id': 'B030302HHE'},\n",
       "  {'parent': 'B0FFIP0V6O',\n",
       "   'address': '朝阳路9号步行街广场6层L6-015-024',\n",
       "   'distance': '324',\n",
       "   'biz_ext': {'cost': [], 'seat_ordering': '0', 'rating': '4.0'},\n",
       "   'pname': '广西壮族自治区',\n",
       "   'importance': [],\n",
       "   'biz_type': 'cinema',\n",
       "   'cityname': '南宁市',\n",
       "   'type': '体育休闲服务;影剧院;电影院',\n",
       "   'photos': [{'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/2606e42595378dc0641e447fb4c6c300'},\n",
       "    {'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/3062b1625e95917a2d6ac99f8c4c21a5'},\n",
       "    {'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/8de9a3079b409ad0551663b84c39a5fe'}],\n",
       "   'typecode': '080601',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': '202',\n",
       "   'adname': '兴宁区',\n",
       "   'name': '中影环球国际影城(百盛步行街店)',\n",
       "   'location': '108.321422,22.813752',\n",
       "   'tel': '0771-2872618',\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFIGYK1N'},\n",
       "  {'parent': 'B03030V6ZI',\n",
       "   'address': '民族大道41号国贸中心A座1906',\n",
       "   'distance': '387',\n",
       "   'biz_ext': {'cost': [], 'rating': '4.8'},\n",
       "   'pname': '广西壮族自治区',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '南宁市',\n",
       "   'type': '体育休闲服务;体育休闲服务场所;体育休闲服务场所',\n",
       "   'photos': [{'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/4af15fe06f1eb9334d1e877651e95263'},\n",
       "    {'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/4652BABA43B945718850CCDD6767F696'},\n",
       "    {'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/ae359f37d6fc135bd999685f36f7a529'}],\n",
       "   'typecode': '080000',\n",
       "   'shopinfo': '1',\n",
       "   'poiweight': [],\n",
       "   'childtype': '202',\n",
       "   'adname': '青秀区',\n",
       "   'name': '泡小影私人影院',\n",
       "   'location': '108.323985,22.813839',\n",
       "   'tel': '0771-2856823;0771-2586823;18677092253',\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFJ04295'},\n",
       "  {'parent': 'B03030V6ZI',\n",
       "   'address': '民族大道41号国贸中心A座11层1116',\n",
       "   'distance': '388',\n",
       "   'biz_ext': {'cost': '25.00', 'rating': []},\n",
       "   'pname': '广西壮族自治区',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '南宁市',\n",
       "   'type': '体育休闲服务;体育休闲服务场所;体育休闲服务场所',\n",
       "   'photos': [],\n",
       "   'typecode': '080000',\n",
       "   'shopinfo': '1',\n",
       "   'poiweight': [],\n",
       "   'childtype': '202',\n",
       "   'adname': '青秀区',\n",
       "   'name': '酸甜笑果私人影院',\n",
       "   'location': '108.323906,22.813782',\n",
       "   'tel': '0771-2858682;18154606626',\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFJLW16I'},\n",
       "  {'parent': 'B0303078YD',\n",
       "   'address': '民族大道12号丽原天际城2层',\n",
       "   'distance': '489',\n",
       "   'biz_ext': {'cost': '50.00', 'seat_ordering': '0', 'rating': []},\n",
       "   'pname': '广西壮族自治区',\n",
       "   'importance': [],\n",
       "   'biz_type': 'cinema',\n",
       "   'cityname': '南宁市',\n",
       "   'type': '体育休闲服务;影剧院;电影院',\n",
       "   'photos': [{'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/9120f2dfb692523ce4be749b3b882a0e'},\n",
       "    {'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/f7787f983ccfbc8be5df11994b87b472'},\n",
       "    {'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/30c7b75b0a787acd8d1dd2e2d1a4ae9d'}],\n",
       "   'typecode': '080601',\n",
       "   'shopinfo': '1',\n",
       "   'poiweight': [],\n",
       "   'childtype': '202',\n",
       "   'adname': '青秀区',\n",
       "   'name': 'GTS影城(南宁店)',\n",
       "   'location': '108.323198,22.812459',\n",
       "   'tel': '0771-2858973',\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFI703Z0'},\n",
       "  {'parent': [],\n",
       "   'address': '民主路20号南宁市工人文化宫职工文体活动中心3-4层',\n",
       "   'distance': '518',\n",
       "   'biz_ext': {'cost': [], 'rating': [], 'meal_ordering': '0'},\n",
       "   'pname': '广西壮族自治区',\n",
       "   'importance': [],\n",
       "   'biz_type': 'diner',\n",
       "   'cityname': '南宁市',\n",
       "   'type': '餐饮服务;咖啡厅;咖啡厅',\n",
       "   'photos': [],\n",
       "   'typecode': '050500',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '兴宁区',\n",
       "   'name': '幸福蓝海国际影城·饮品店',\n",
       "   'location': '108.324543,22.820540',\n",
       "   'tel': '0771-3911680',\n",
       "   'shopid': [],\n",
       "   'id': 'B0G3A672PG'},\n",
       "  {'parent': 'B0FFGYFYT4',\n",
       "   'address': '民主路20号南宁百货3层',\n",
       "   'distance': '522',\n",
       "   'biz_ext': {'cost': '25.00', 'seat_ordering': '0', 'rating': '4.0'},\n",
       "   'pname': '广西壮族自治区',\n",
       "   'importance': [],\n",
       "   'biz_type': 'cinema',\n",
       "   'cityname': '南宁市',\n",
       "   'type': '体育休闲服务;影剧院;电影院',\n",
       "   'photos': [{'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/df357fc3dbbe76ae1a292b8d9687454a'},\n",
       "    {'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/cbb60a4fdb7d783463d1e4408402d2b4'},\n",
       "    {'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/d8278903eb2063f754410e2df5ed20e4'}],\n",
       "   'typecode': '080601',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': '202',\n",
       "   'adname': '兴宁区',\n",
       "   'name': '幸福蓝海国际影城(南宁店)',\n",
       "   'location': '108.324322,22.820709',\n",
       "   'tel': '0771-3911680',\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFH2W6FQ'},\n",
       "  {'parent': [],\n",
       "   'address': '人民东路与人民路北二里交叉口东北150米',\n",
       "   'distance': '553',\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'pname': '广西壮族自治区',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '南宁市',\n",
       "   'type': '购物服务;家电电子卖场;家电电子卖场',\n",
       "   'photos': [],\n",
       "   'typecode': '060300',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '兴宁区',\n",
       "   'name': '金正家庭影院',\n",
       "   'location': '108.322767,22.821535',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFHSQGPS'},\n",
       "  {'parent': 'B030300671',\n",
       "   'address': '东葛路1号锦华大酒店三楼',\n",
       "   'distance': '842',\n",
       "   'biz_ext': {'cost': [], 'rating': '4.0'},\n",
       "   'pname': '广西壮族自治区',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '南宁市',\n",
       "   'type': '生活服务;洗浴推拿场所;洗浴推拿场所',\n",
       "   'photos': [],\n",
       "   'typecode': '071400',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': '202',\n",
       "   'adname': '青秀区',\n",
       "   'name': '梵隆汇影院式养生公馆',\n",
       "   'location': '108.330038,22.815993',\n",
       "   'tel': '0771-5869777',\n",
       "   'shopid': [],\n",
       "   'id': 'B0G259YQ4K'},\n",
       "  {'parent': [],\n",
       "   'address': '新民路与纬武路交叉口西100米',\n",
       "   'distance': '923',\n",
       "   'biz_ext': {'cost': '14792.00', 'rating': []},\n",
       "   'pname': '广西壮族自治区',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '南宁市',\n",
       "   'type': '商务住宅;住宅区;宿舍',\n",
       "   'photos': [{'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/56455cc4a310f93e66c27c38'},\n",
       "    {'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/56455cc4a310f93e66c27c3a'},\n",
       "    {'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/0bf985eadcf791b7314afc0e6985fcf5'}],\n",
       "   'typecode': '120303',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '青秀区',\n",
       "   'name': '广西广播电影电视局第一宿舍',\n",
       "   'location': '108.328160,22.810814',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B030305Z8Y'},\n",
       "  {'parent': [],\n",
       "   'address': '第5大道天成一品C区',\n",
       "   'distance': '947',\n",
       "   'biz_ext': {'cost': [],\n",
       "    'star': [],\n",
       "    'rating': '5.0',\n",
       "    'lowest_price': '118.00',\n",
       "    'hotel_ordering': '1'},\n",
       "   'pname': '广西壮族自治区',\n",
       "   'importance': [],\n",
       "   'biz_type': 'hotel',\n",
       "   'cityname': '南宁市',\n",
       "   'type': '住宿服务;住宿服务相关;住宿服务相关',\n",
       "   'photos': [{'provider': [],\n",
       "     'title': 'Logo',\n",
       "     'url': 'http://store.is.autonavi.com/showpic/2ecae7ce2b4a80febe3c4c2c641ffdc9'},\n",
       "    {'provider': [],\n",
       "     'title': '客房',\n",
       "     'url': 'http://store.is.autonavi.com/showpic/a55a35eeeec1596b9ec3a306c6c72ff8'},\n",
       "    {'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/0388234020bbe1694a7886886995d8b1'}],\n",
       "   'typecode': '100000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '兴宁区',\n",
       "   'name': '南宁freedoom影院民宿',\n",
       "   'location': '108.316572,22.823695',\n",
       "   'tel': '0771-4375750',\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFL99RP6'},\n",
       "  {'parent': 'B03030060B',\n",
       "   'address': '民族大道20号广西科技馆F2',\n",
       "   'distance': '985',\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'pname': '广西壮族自治区',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '南宁市',\n",
       "   'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "   'photos': [{'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/4ce7f077da6bdbe339b3e7ceec77b1e8'}],\n",
       "   'typecode': '140000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': '202',\n",
       "   'adname': '青秀区',\n",
       "   'name': '广西科技馆动感4d球幕电影',\n",
       "   'location': '108.330230,22.812481',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFF9TWGC'},\n",
       "  {'parent': [],\n",
       "   'address': '七星路123号广电广播电视局8号楼',\n",
       "   'distance': '1018',\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'pname': '广西壮族自治区',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '南宁市',\n",
       "   'type': '生活服务;生活服务场所;生活服务场所',\n",
       "   'photos': [],\n",
       "   'typecode': '070000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '青秀区',\n",
       "   'name': '元野电影工作室',\n",
       "   'location': '108.328295,22.809771',\n",
       "   'tel': '14795589514',\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFJH094T'},\n",
       "  {'parent': [],\n",
       "   'address': '七星路123号',\n",
       "   'distance': '1040',\n",
       "   'biz_ext': {'cost': [], 'rating': []},\n",
       "   'pname': '广西壮族自治区',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '南宁市',\n",
       "   'type': '政府机构及社会团体;政府机关;省直辖市级政府及事业单位',\n",
       "   'photos': [{'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/56455cc9a310f93e66c27da8'},\n",
       "    {'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/e47cb5332c37e2eab4a129ed1467f1e6'},\n",
       "    {'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/ee72c239f64c3db85b2ce33270580f85'}],\n",
       "   'typecode': '130102',\n",
       "   'shopinfo': '2',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '青秀区',\n",
       "   'name': '广西壮族自治区广播电影电视局',\n",
       "   'location': '108.327979,22.809273',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B030301BSQ'},\n",
       "  {'parent': [],\n",
       "   'address': '新民路6-1号',\n",
       "   'distance': '1120',\n",
       "   'biz_ext': {'cost': '13218.00', 'rating': []},\n",
       "   'pname': '广西壮族自治区',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '南宁市',\n",
       "   'type': '商务住宅;住宅区;宿舍',\n",
       "   'photos': [{'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/564a99a7a310db76f345097b'},\n",
       "    {'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/564a99a7a310db76f345097f'},\n",
       "    {'provider': [],\n",
       "     'title': [],\n",
       "     'url': 'http://store.is.autonavi.com/showpic/b2ac86f290d66e40db989e08724be525'}],\n",
       "   'typecode': '120303',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '青秀区',\n",
       "   'name': '广西广播电影电视局第二宿舍',\n",
       "   'location': '108.329728,22.809777',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B03030TQA3'}],\n",
       " 'status': '1',\n",
       " 'info': 'OK'}"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "keywords='电影'\n",
    "location='108.321759,22.816652'\n",
    "around(location,keywords)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "5.3多边形搜索"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [],
   "source": [
    "def poly(key,polygon,keywords=None,types=None,offset='20',page='1',extensions='base',sig=None,output='json',callback=None):\n",
    "    #多边形搜索\n",
    "    url='https://restapi.amap.com/v3/place/polygon?parameters '\n",
    "    params={\n",
    "        'key':key,\n",
    "        'polygon':polygon,\n",
    "        'keywords':keywords,\n",
    "        'types':types,\n",
    "        'offset':offset,\n",
    "        'page':page,\n",
    "        'extensions':extensions,\n",
    "        'sig':sig,\n",
    "        'output':output,\n",
    "        'callback':callback     \n",
    "    }\n",
    "    response=requests.get(url,params)\n",
    "    results=response.json()\n",
    "    return results"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'suggestion': {'keywords': [], 'cities': []},\n",
       " 'count': '5',\n",
       " 'infocode': '10000',\n",
       " 'pois': [{'parent': 'BV10532020',\n",
       "   'address': '1号线;2号线',\n",
       "   'distance': [],\n",
       "   'biz_ext': [],\n",
       "   'pname': '广西壮族自治区',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '南宁市',\n",
       "   'type': '交通设施服务;地铁站;出入口',\n",
       "   'photos': [],\n",
       "   'typecode': '150501',\n",
       "   'shopinfo': '2',\n",
       "   'poiweight': [],\n",
       "   'childtype': '107',\n",
       "   'adname': '兴宁区',\n",
       "   'name': '朝阳广场地铁站F口',\n",
       "   'location': '108.321285,22.815448',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'BX10022342'},\n",
       "  {'parent': 'B0303054XG',\n",
       "   'address': '青云街18号悦荟广场A座B1层',\n",
       "   'distance': [],\n",
       "   'biz_ext': [],\n",
       "   'pname': '广西壮族自治区',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '南宁市',\n",
       "   'type': '交通设施服务;停车场;公共停车场',\n",
       "   'photos': [],\n",
       "   'typecode': '150904',\n",
       "   'shopinfo': '2',\n",
       "   'poiweight': [],\n",
       "   'childtype': '305',\n",
       "   'adname': '兴宁区',\n",
       "   'name': '停车场B区(悦荟广场A座)',\n",
       "   'location': '108.322764,22.814577',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFHW8FLX'},\n",
       "  {'parent': [],\n",
       "   'address': '青云街与兴达街交叉口西南方向30米',\n",
       "   'distance': [],\n",
       "   'biz_ext': [],\n",
       "   'pname': '广西壮族自治区',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '南宁市',\n",
       "   'type': '商务住宅;住宅区;住宅区',\n",
       "   'photos': [],\n",
       "   'typecode': '120300',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '兴宁区',\n",
       "   'name': '柏仕公馆',\n",
       "   'location': '108.322771,22.814598',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0FFLB0QNU'},\n",
       "  {'parent': [],\n",
       "   'address': '民族大道41号国贸中心购物广场4楼4B010',\n",
       "   'distance': [],\n",
       "   'biz_ext': [],\n",
       "   'pname': '广西壮族自治区',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '南宁市',\n",
       "   'type': '商务住宅;商务住宅相关;商务住宅相关',\n",
       "   'photos': [],\n",
       "   'typecode': '120000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': [],\n",
       "   'adname': '兴宁区',\n",
       "   'name': '战岚四季乱语',\n",
       "   'location': '108.321715,22.815109',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B03030VTNK'},\n",
       "  {'parent': 'B0FFKS680T',\n",
       "   'address': '青云街18号',\n",
       "   'distance': [],\n",
       "   'biz_ext': [],\n",
       "   'pname': '广西壮族自治区',\n",
       "   'importance': [],\n",
       "   'biz_type': [],\n",
       "   'cityname': '南宁市',\n",
       "   'type': '商务住宅;商务住宅相关;商务住宅相关',\n",
       "   'photos': [],\n",
       "   'typecode': '120000',\n",
       "   'shopinfo': '0',\n",
       "   'poiweight': [],\n",
       "   'childtype': '308',\n",
       "   'adname': '兴宁区',\n",
       "   'name': '印象城B座',\n",
       "   'location': '108.323275,22.814361',\n",
       "   'tel': [],\n",
       "   'shopid': [],\n",
       "   'id': 'B0GUZ9HNDS'}],\n",
       " 'status': '1',\n",
       " 'info': 'OK'}"
      ]
     },
     "execution_count": 50,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "polygon='108.323985,22.813839|108.321096,22.815424|108.321510,22.815693'\n",
    "poly(key,polygon,keywords=None,types=None,offset='20',page='1',extensions='base',sig=None,output='json',callback=None)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "5.4ID查询"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {},
   "outputs": [],
   "source": [
    "def detail(id):\n",
    "    #id查询搜索\n",
    "    url='https://restapi.amap.com/v3/place/polygon?parameters '\n",
    "    key='de6216071f58b9c3b96bf20013f009e2'\n",
    "    params={\n",
    "        'key':key,\n",
    "        'id':id\n",
    "      \n",
    "    }\n",
    "    response=requests.get(url,params)\n",
    "    results=response.json()\n",
    "    return results"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'suggestion': {'keywords': [], 'cities': []},\n",
       " 'count': '0',\n",
       " 'infocode': '10000',\n",
       " 'pois': [],\n",
       " 'status': '1',\n",
       " 'info': 'OK'}"
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "id=''\n",
    "detail(id)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 6. IP定位"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "outputs": [],
   "source": [
    "def ip(key,id):\n",
    "    # ip定位\n",
    "    url='https://restapi.amap.com/v3/ip?parameters'\n",
    "    key='de6216071f58b9c3b96bf20013f009e2'\n",
    "    params={\n",
    "        'key':key,\n",
    "        'id':id\n",
    "      \n",
    "    }\n",
    "    response=requests.get(url,params)\n",
    "    results=response.json()\n",
    "    return results"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000',\n",
       " 'province': '广东省',\n",
       " 'city': '广州市',\n",
       " 'adcode': '440100',\n",
       " 'rectangle': '113.1017375,22.93212254;113.6770499,23.3809537'}"
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "id='B0GUZ9HNDS'\n",
    "ip(key,id)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 7.静态地图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {},
   "outputs": [],
   "source": [
    "def amap(key,location,zoom,size='400*400',scale='1',markers=None,labels=None,paths=None,traffic='0',sig=None):\n",
    "    #获取静态地图信息\n",
    "    url='https://restapi.amap.com/v3/staticmap?parameters'\n",
    "    params={\n",
    "    'key':key,\n",
    "    'location':location,\n",
    "    'zoom':zoom,\n",
    "    'scale':scale,\n",
    "    'markers':markers,\n",
    "    'labels':labels,\n",
    "    'paths':paths,\n",
    "    'traffic':traffic,\n",
    "    'sig':sig\n",
    "    }\n",
    "    r=requests.get(url,params)\n",
    "    data=r.url\n",
    "    return data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'https://restapi.amap.com/v3/staticmap?parameters&key=de6216071f58b9c3b96bf20013f009e2&location=113.677460%2C23.630490&zoom=17&scale=1'"
      ]
     },
     "execution_count": 56,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "location='113.677460,23.630490'\n",
    "zoom='17'\n",
    "amap(key,location,zoom,size='400*400',scale='1',markers=None,labels=None,paths=None,traffic=None,sig=None)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 8.地标转换"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [],
   "source": [
    "def convert(key,locations,coordays='',sig='',output=''):\n",
    "    url='https://restapi.amap.com/v3/assistant/coordinate/convert?parameters'\n",
    "    params={\n",
    "        'key':key,\n",
    "        \"locations\":locations,\n",
    "        'coordays':coordays,\n",
    "        'sig':sig,\n",
    "        'output':output\n",
    "    }\n",
    "    response=requests.get(url,params)\n",
    "    r=response.json()\n",
    "    return r"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'info': 'ok',\n",
       " 'infocode': '10000',\n",
       " 'locations': '116.481499,39.990475|116.481499,39.990375'}"
      ]
     },
     "execution_count": 58,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "locations='116.481499,39.990475|116.481499,39.990375'\n",
    "convert(key,locations,coordays='',sig='',output='')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 9.天气查询"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [],
   "source": [
    "def weather(key,city,extensions='base',output=''):\n",
    "    # 天气查询\n",
    "    url='https://restapi.amap.com/v3/weather/weatherInfo?parameters'\n",
    "    params={\n",
    "        'key':key,\n",
    "       'city':city,\n",
    "        'extensions':extensions,\n",
    "        'output':output\n",
    "    }\n",
    "    response=requests.get(url,params)\n",
    "    r=response.json()\n",
    "    return r"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'count': '1',\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000',\n",
       " 'lives': [{'province': '广东',\n",
       "   'city': '从化区',\n",
       "   'adcode': '440117',\n",
       "   'weather': '晴',\n",
       "   'temperature': '22',\n",
       "   'winddirection': '东南',\n",
       "   'windpower': '≤3',\n",
       "   'humidity': '93',\n",
       "   'reporttime': '2020-11-17 19:22:45'}]}"
      ]
     },
     "execution_count": 62,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "city='440117'\n",
    "weather(key,city,extensions='base',output='')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 10.输入提示"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {},
   "outputs": [],
   "source": [
    "def input(key,keywords,type=None,location=None,city=None,\n",
    "          citylimit='false',datatype=None,sig=None,output='json',callback=None):\n",
    "    # 输入提示\n",
    "    url='https://restapi.amap.com/v3/assistant/inputtips?parameters'\n",
    "    params={\n",
    "        'key':key,\n",
    "        'keywords':keywords,\n",
    "        'type':type,\n",
    "        'location':location,\n",
    "        'city':city,\n",
    "        'citylimit':citylimit,\n",
    "        'datatype':datatype,\n",
    "        'sig':sig,\n",
    "        'output':output,\n",
    "        'callback':callback\n",
    "    }\n",
    "    response=requests.get(url,params)\n",
    "    r=response.json()\n",
    "    return r"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'count': '10',\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000',\n",
       " 'tips': [{'id': 'BV10851522',\n",
       "   'name': '从化客运站(地铁站)',\n",
       "   'district': '广东省广州市从化区',\n",
       "   'adcode': '440117',\n",
       "   'location': '113.594721,23.531769',\n",
       "   'address': '14号线',\n",
       "   'typecode': '150500',\n",
       "   'city': []},\n",
       "  {'id': 'BX10026006',\n",
       "   'name': '从化客运站地铁站A口',\n",
       "   'district': '广东省广州市从化区',\n",
       "   'adcode': '440117',\n",
       "   'location': '113.594446,23.531124',\n",
       "   'address': '14号线',\n",
       "   'typecode': '150501',\n",
       "   'city': []},\n",
       "  {'id': 'BX10026244',\n",
       "   'name': '从化客运站地铁站C1口',\n",
       "   'district': '广东省广州市从化区',\n",
       "   'adcode': '440117',\n",
       "   'location': '113.594892,23.532544',\n",
       "   'address': '14号线',\n",
       "   'typecode': '150501',\n",
       "   'city': []},\n",
       "  {'id': 'BX10026243',\n",
       "   'name': '从化客运站地铁站B口',\n",
       "   'district': '广东省广州市从化区',\n",
       "   'adcode': '440117',\n",
       "   'location': '113.595444,23.532157',\n",
       "   'address': '14号线',\n",
       "   'typecode': '150501',\n",
       "   'city': []},\n",
       "  {'id': 'BX10026370',\n",
       "   'name': '从化客运站地铁站D口',\n",
       "   'district': '广东省广州市从化区',\n",
       "   'adcode': '440117',\n",
       "   'location': '113.594098,23.530721',\n",
       "   'address': '14号线',\n",
       "   'typecode': '150501',\n",
       "   'city': []},\n",
       "  {'id': 'BV11168223',\n",
       "   'name': '地铁从化客运站2(公交站)',\n",
       "   'district': '广东省广州市从化区',\n",
       "   'adcode': '440117',\n",
       "   'location': '113.593025,23.531250',\n",
       "   'address': '从10路;从16路;从17路;从17路(18点后);从18路;从1路;从20路;从21路;从2路;从3路;从4路;从5路;从6路;从901路;从902路;从903路;从9路;从夜1路;从夜2路',\n",
       "   'typecode': '150700',\n",
       "   'city': []},\n",
       "  {'id': 'BX10026005',\n",
       "   'name': '从化客运站地铁站C2口',\n",
       "   'district': '广东省广州市从化区',\n",
       "   'adcode': '440117',\n",
       "   'location': '113.594203,23.531854',\n",
       "   'address': '14号线',\n",
       "   'typecode': '150501',\n",
       "   'city': []},\n",
       "  {'id': 'BV11154757',\n",
       "   'name': '地铁从化客运站1(公交站)',\n",
       "   'district': '广东省广州市从化区',\n",
       "   'adcode': '440117',\n",
       "   'location': '113.594614,23.530182',\n",
       "   'address': '从11路;从12路;从14路;从19路;从2路;从4路快线;从904路;从905路',\n",
       "   'typecode': '150700',\n",
       "   'city': []},\n",
       "  {'id': 'BV11154215',\n",
       "   'name': '地铁从化客运站(公交站)',\n",
       "   'district': '广东省广州市从化区',\n",
       "   'adcode': '440117',\n",
       "   'location': '113.594206,23.530317',\n",
       "   'address': '从19路密石班车',\n",
       "   'typecode': '150700',\n",
       "   'city': []},\n",
       "  {'id': 'B00140V0TX',\n",
       "   'name': '从化汽车站',\n",
       "   'district': '广东省广州市从化区',\n",
       "   'adcode': '440117',\n",
       "   'location': '113.599374,23.528771',\n",
       "   'address': '从城大道28号',\n",
       "   'typecode': '150400',\n",
       "   'city': []}]}"
      ]
     },
     "execution_count": 64,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "keywords='从化客运站'\n",
    "input(key,keywords,type=None,location=None,city=None,citylimit='false',datatype=None,sig=None,output='json',callback=None)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 11.交通态势"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {},
   "outputs": [],
   "source": [
    "def traffic(key,rectangle,level='5',extensions='base',sig=None,output='json',callback=None):\n",
    "    url='https://restapi.amap.com/v3/traffic/status/rectangle?parameters'\n",
    "    params={\n",
    "        'key':key,\n",
    "        'rectangle':rectangle,\n",
    "        'level':level,\n",
    "        'extensions':extensions,\n",
    "        'sig':sig,\n",
    "        'output':output,\n",
    "        'callback':callback,\n",
    "    }\n",
    "    response=requests.get(url,params)\n",
    "    r=response.json()\n",
    "    return r"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'info': 'INSUFFICIENT_PRIVILEGES',\n",
       " 'infocode': '10012',\n",
       " 'status': '0',\n",
       " 'sec_code_debug': 'd41d8cd98f00b204e9800998ecf8427e',\n",
       " 'key': 'de6216071f58b9c3b96bf20013f009e2',\n",
       " 'sec_code': 'd41d8cd98f00b204e9800998ecf8427e'}"
      ]
     },
     "execution_count": 66,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "rectangle='113.594203,23.531854;113.599374,23.528771'\n",
    "traffic(key,rectangle,level='5',extensions='base',sig=None,output='json',callback=None)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
